tjapple tjapple - 1 year ago 294
C# Question

Entity Framework equivalent of InsertonSubmit

I know there is a question with basically the same header but is different in my case. I moved from Linq-to-SQL to Entity Framework (which I am a little new to) and I have a method where I use

, and so I found out it is in Linq-to-SQL and not in Entity Framework, any ideas?



Answer Source

You don't need to call InsertOnSubmit in Entity Framework.

You can simply create a new object of what you want to add in database and then call SaveChanges method.

Entities entities = new Entities();

Employee emp = new Employee();
emp.Name = "Mairaj";

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download