zain85 / dapper-dot-net

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

Mapping object Prop names to DB column names #55

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Sorry - didn't found a way to map in 1.6 db column names to the object prop 
names, had to add that myself, not a big deal. But will be nice to have that in 
a future version.

Original issue reported on code.google.com by daniil.b...@gmail.com on 29 Jul 2011 at 4:31

GoogleCodeExporter commented 8 years ago
Can you post some code on how you did it?

Original comment by cjcame...@gmail.com on 15 Sep 2011 at 4:10

GoogleCodeExporter commented 8 years ago
My changed (sorry - not sure that's the latest one i've used in a project) 
version attached, apply SqlName attribute with your db field name specified to 
a field or property. 

Original comment by daniil.b...@gmail.com on 15 Sep 2011 at 4:41

Attachments:

GoogleCodeExporter commented 8 years ago
Dude, see issue 50 and vote it :)

Original comment by sdsilve...@gmail.com on 2 Dec 2011 at 12:05

GoogleCodeExporter commented 8 years ago
Is there any way to do this with the current version?
example:
class Person
{
 [TableColumnAnnotation("p_id")]
 int PersonId { get; set;}
....
}

So dapper can get the Annotation from the class definition and map it to the 
table column name...

Original comment by martinez...@gmail.com on 17 Jan 2014 at 2:54