Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

entity framework insert

 var id = Guid.NewGuid();

 // insert
 using (var db = new EfContext("name=EfSample"))
 {
    var customers = db.Set<Customer>();
    customers.Add( new Customer { CustomerId = id, Name = "John Doe" } );

    db.SaveChanges();
 }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #entity #framework #insert
ADD COMMENT
Topic
Name
9+3 =