entity save example in c# model first
using (var context = new BloggingContext())
{
// seeding database
context.Blogs.Add(new Blog { Url = "http://example.com/blog" });
context.Blogs.Add(new Blog { Url = "http://example.com/another_blog" });
context.SaveChanges();
}
using (var context = new BloggingContext())
{
// add
context.Blogs.Add(new Blog { Url = "http://example.com/blog_one" });
context.Blogs.Add(new Blog { Url = "http://example.com/blog_two" });
// update
var firstBlog = context.Blogs.First();
firstBlog.Url = "";
// remove
var lastBlog = context.Blogs.Last();
context.Blogs.Remove(lastBlog);
context.SaveChanges();
}