I’m trying to build database using schema first (EF5) and add it simple membership as well.
After ”drawing” my schema I have add user profile table (UserId&UserName) remove the
Filter: InitializeSimpleMembershipAttribute, remove all of this ..
//public class UsersContext : DbContext
//{
// public UsersContext()
// : base("DefaultConnection")
// {
// }
// public DbSet<UserProfile> UserProfiles { get; set; }
//}
//[Table("UserProfile")]
//public class UserProfile
//{
// [Key]
// [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
// public int UserId { get; set; }
// public string UserName { get; set; }
//}
In the generated class (by schema first) I have tried to add manually
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
to my UserProfile class
I have also register in my AppStart :
WebSecurity.InitializeDatabaseConnection("Model1Container", "UserProfile",
"UserId", "UserName", autoCreateTables: true);
But on debug I’m getting this error :
Unable to find the requested .Net Framework Data Provider. It may not be installed
WebSecurity.InitializeDatabaseConnection("Model1Container", "UserProfile",
Is there a good practice how to do it ?
Is it possible using schema first ?