Main Page | Report this Page
.NET DotNet Forum Index  »  ADO .NET Forum  »  Using Existing Classes in Entity Framework...
Page 1 of 1    

Using Existing Classes in Entity Framework...

Author Message
tobiwan_kenobi...
Posted: Mon Oct 26, 2009 10:02 pm
Guest
We currently use NHibernate. We are evaluating the Entity Framework.

We would like to use our existing classes without modification. Where can I
find information on mapping private member variables to the database in the
entity framework.

We are looking for non-invasive methods of hooking up entity framework to
our classes. We are not disposed to altering our classes to put ORM-specific
attributes on either methods or variables. And we don't want to use methods
because it generally requires both public getters and setters. This breaks
the security for the object model that we have decided to use.

ps. If there is a better place to post this, please let me know, but I
didn't see discussion groups that say entity framework.
 
Gregory A. Beamer...
Posted: Tue Oct 27, 2009 8:32 am
Guest
=?Utf-8?B?dG9iaXdhbl9rZW5vYmk=?=
<tobiwankenobi at (no spam) discussions.microsoft.com> wrote in
news:04429FC1-4AEC-4A42-9891-DC980CEE2BDF at (no spam) microsoft.com:

Quote:
We currently use NHibernate. We are evaluating the Entity Framework.

We would like to use our existing classes without modification. Where
can I find information on mapping private member variables to the
database in the entity framework.

We are looking for non-invasive methods of hooking up entity framework
to our classes. We are not disposed to altering our classes to put
ORM-specific attributes on either methods or variables. And we don't
want to use methods because it generally requires both public getters
and setters. This breaks the security for the object model that we
have decided to use.

ps. If there is a better place to post this, please let me know, but
I didn't see discussion groups that say entity framework.


The suggested way to accomplish this is:
http://msdn.microsoft.com/en-us/library/bb738631.aspx

NOTE that you are inheriting from a EF base class, os this IS altering you
existing classes, breaking one of your "requirements".

If you are strict about the "no changes" policy, I would consider
implementing a Mapper or Translator pattern.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: at (no spam) gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Sat Nov 28, 2009 12:45 am