fmwviormv / sqlite-net

Automatically exported from code.google.com/p/sqlite-net
0 stars 0 forks source link

Add IgnoreAttribute so that some props can be flagged #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

Please use labels and text to provide additional information.

Original issue reported on code.google.com by frank.al...@gmail.com on 27 Jan 2010 at 8:04

GoogleCodeExporter commented 9 years ago
Here's all that's needed to make that work:

Add the attribute class so that you can mark properties as [Ignore]

public class IgnoreAttribute : Attribute {}

in the TableMapping Constructor add this line to the top of the 

foreach (var p in props) 
{
     // added to make the IgnoreAttribute work
     // should probably be broken out, but hey, this works and its quick.
     if(p.GetCustomAttributes(typeof(SQLite.IgnoreAttribute), true).Any()) continue;

... keep the rest of the code

}

Of course this has not been extensively tested, but I am using it and it works. 

Original comment by roberoc...@gmail.com on 27 Mar 2010 at 2:41

GoogleCodeExporter commented 9 years ago
Rev 58

Original comment by frank.al...@gmail.com on 29 Jun 2010 at 6:55