A colleague and I have been trying to augment an existing database with entity framework code first and we are having no luck achieving what we need to do.
In a nutshell, we have an existing database which has a user type InternetUser. We are upgrading the project and trying to integrate the MembershipReboot code. That code has a concept (and entity) of a UserAccount. So, we decided that we would connect these two types with a foreign key in the InternetUser object that references the primary key (a GUID) of the relevant UserAccount object.
We created our entities by using the entity framework Power Tools and reverse engineering. We then manually connected the InternetUser type with the UserAccount in MembershipReboot by including a UserAccountId property.
The complexity in this migration comes from the fact that some hashing (cryptography) code in the MembershipReboot library needs to run whenever a UserAccount is created. I am not quite sure how to do that in the seed method using EF code first. So, it is not just a case of running a SQL script when seeding. Some C# needs to run to create the user using MembershipReboot.
If anyone has tried to accomplish something similar, I would love to hear from them and how they solved the problem.