Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
Dapper
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
Dapper
Commits
4c2362ff
Commit
4c2362ff
authored
May 07, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #79 from vonbv/master
Support for "ignoring Navigation Property"
parents
2a3bf22f
edde1eb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
Dapper.Rainbow.csproj
Dapper.Rainbow/Dapper.Rainbow.csproj
+1
-0
Database.cs
Dapper.Rainbow/Database.cs
+6
-1
IgnorePropertyAttribute.cs
Dapper.Rainbow/IgnorePropertyAttribute.cs
+15
-0
No files found.
Dapper.Rainbow/Dapper.Rainbow.csproj
View file @
4c2362ff
...
...
@@ -41,6 +41,7 @@
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Database.cs"
/>
<Compile
Include=
"IgnorePropertyAttribute.cs"
/>
<Compile
Include=
"Snapshotter.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"SqlCompactDatabase.cs"
/>
...
...
Dapper.Rainbow/Database.cs
View file @
4c2362ff
...
...
@@ -129,7 +129,12 @@ internal static List<string> GetParamNames(object o)
paramNames
=
new
List
<
string
>();
foreach
(
var
prop
in
o
.
GetType
().
GetProperties
(
BindingFlags
.
GetProperty
|
BindingFlags
.
Instance
|
BindingFlags
.
Public
))
{
paramNames
.
Add
(
prop
.
Name
);
var
attribs
=
prop
.
GetCustomAttributes
(
typeof
(
IgnorePropertyAttribute
),
true
);
var
attr
=
attribs
.
FirstOrDefault
()
as
IgnorePropertyAttribute
;
if
(
attr
==
null
||
(
attr
!=
null
&&
!
attr
.
Value
))
{
paramNames
.
Add
(
prop
.
Name
);
}
}
paramNameCache
[
o
.
GetType
()]
=
paramNames
;
}
...
...
Dapper.Rainbow/IgnorePropertyAttribute.cs
0 → 100644
View file @
4c2362ff
using
System
;
namespace
Dapper
{
[
AttributeUsage
(
AttributeTargets
.
Property
,
AllowMultiple
=
true
)]
public
class
IgnorePropertyAttribute
:
Attribute
{
public
IgnorePropertyAttribute
(
bool
ignore
)
{
Value
=
ignore
;
}
public
bool
Value
{
get
;
set
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment