Using ASP.NET Entity Framework, how can I change the Foreign Key association between two entities?
Here's an example scenario:
--------------- ----------------
| Customer | | Class |
--------------- ----------------
| ID | | Desctription |
| Name | | Name |
| ClassID (FK)|-----| ID |
--------------- ----------------
A customer starts as a Class D customer. The more the customer spends, the classification will change to C, B or A. How can I do this using the EF?
I've set up a facade between the EF and my solution (because some operations requires operations outside EF), and I tried doing it this way:
customer.Context.Class.ID = facade.SelectClass(ClassID)
That returns a Business Object of Class, but the customer.Context.Class.ID wants a Data Layer object, and while I could do that, it would mean I break away from the set layer design.
Is there any way around this?
Sorry if the question is a bit messy or fuzzy.