I’m trying to insert some data in my database using Entity Framework model, but for some unknown reasons to me, it does nothing.
Am I missing something here?
using (var context = new DatabaseEntities())
{
var t = new test
{
ID = Guid.NewGuid(),
name = "blah",
};
context.AddTotest(t);
context.SaveChanges();
}
It should be:
For versions of entity framework before 6, it was:
Where:
TableName: the name of the table in the database.TableEntityInstance: an instance of the table entity class.If your table is
Orders, then:For example:
Here is an example: