Wiki Link: [discussion:1486]
Infusing POCO objects into standard EDM 

Mar 25 2009 at 1:21 PM
I've looked into both your POCO Adapter and the EF Extentions projects, but am still struggling to find a means to infuse POCO objects into an EDM without the need for a mapping to a database table.

My scenario is as follows: I've got a new project unfolding where the custom business objects will be persisted into SQL Server. However, I'm also leveraging ASP.Net Membership Provider to abstract security infrastructure. I'm specifically NOT using SQL Server as a backing store for my members / roles / profiles and will source these from the Provider (as per .config).

My needs are as follows (I realise I need to wrap the System.Web.Security.MembershipUser with an EntityObject descendant):
1. Several entities in my EDM model, for example Audit (abstract Entity), has a scalar property for User (not null). In this case it's a GUID that I want to refactor into an EntityReference with a navigation property ie Audit.User returns a MembershipUser instance NOT a GUID.
2. I'd like to have ObjectQuery<MembershipUser> property on my ObjectContext so that I can "surface" users as 1st class Entities in my model.
3. With my "standard" EDM (database backed) and my POCO infused Users in the same ObjectContext, I want to surface the entire model via Data Services. Users will of course be readonly.

I simply don't know how to proceed to achieve the above.


Updating...
Page view tracker