Reputation: 557
i have probleme with entityframework code first , when i execute my app and save data to database in my controllers it dont't create table for my domain class, i have create context, and add a Dbset variable for my model , i verify all that we need for working with EF but i can't understand wath's the matter , here my code for saving data to dataabase :
foreach (var data in my_friends) {
entity.Friends.Add(data);
}
my_friends contain a list of "UserFriend" that's it's my domain class, entity it's the context, if you have meet this problem in the past , i like that you help me please !!
Upvotes: 0
Views: 99
Reputation: 3821
Try the following:
foreach (var data in my_friends) {
entity.Friends.Add(data);
}
entity.SaveChanges();
Upvotes: 2