column mapping using attributes?

78 views
Skip to first unread message

Rob Segerink

unread,
Apr 26, 2012, 4:22:28 PM4/26/12
to simpl...@googlegroups.com
Hi,

just looking at simple.data for a new project, in this project we have a existing database with very nasty/unreadable column names, 
I would like to have my POCO's using nice property names, so how can I map these two? Can I do something like:

[DbColumnName = "unreadablecolumn"]
string FirstName { get; set;}

thanks,

Rob

Mark Rendle

unread,
Apr 26, 2012, 6:25:48 PM4/26/12
to simpl...@googlegroups.com
I've got an idea for doing something about this, but it won't be
attributes on property names. That would mean you were putting bits of
Simple.Data in your business objects or POCOs, and I don't like that
sort of thing.

What I'm thinking of is an abstract generic type you can derive from
which will have From and To methods; you can hook these up using MEF
attributes and they'll take care of the mapping for you without
polluting your application logic or objects.

I'll reply to this thread again when there's something on GitHub.

Mark

Sent from my iPad (until Win8 gets a mail app)

Dan Maharry

unread,
Apr 27, 2012, 3:19:58 AM4/27/12
to simpl...@googlegroups.com
Is this going to be in a v1.x release Mark?

---

Dan Maharry

web: http://www.hmobius.com
blog: http://blog.hmobius.com
twitter: http://www.twitter.com/hmobius

Mark Rendle

unread,
Apr 27, 2012, 3:37:26 AM4/27/12
to simpl...@googlegroups.com

Yes, I might start a 1.1 -pre release cycle soon.

Rob Segerink

unread,
Apr 27, 2012, 6:04:33 AM4/27/12
to simpl...@googlegroups.com
Thanks Marc,

can't wait to try it out! :)

greetings,

Rob

Op vrijdag 27 april 2012 09:37:26 UTC+2 schreef Mark Rendle het volgende:

Nathan Palmer

unread,
Oct 18, 2012, 9:00:07 PM10/18/12
to simpl...@googlegroups.com
Did this ever happen? I couldn't find any information about it in the docs.

Nathan Palmer
Reply all
Reply to author
Forward
0 new messages