Пример #1
0
 public int CreateBlogEntry(BlogEntry blogEntry)
 {
     base.EbalitDBContext.BlogEntries.Add(blogEntry);
     base.EbalitDBContext.SaveChanges();
     return blogEntry.Id;
 }
Пример #2
0
 public void DeleteBlogEntry(BlogEntry blogEntry)
 {
     base.EbalitDBContext.BlogEntries.Attach(blogEntry);
     base.EbalitDBContext.BlogEntries.Remove(blogEntry);
     base.EbalitDBContext.SaveChanges();
 }
Пример #3
0
 public void UpdateBlogEntry(BlogEntry blogEntry)
 {
     var originalRecord = base.EbalitDBContext.BlogEntries.Find(blogEntry.Id);
     if (originalRecord != null)
     {
         base.EbalitDBContext.Entry(originalRecord).CurrentValues.SetValues(blogEntry);
         base.EbalitDBContext.SaveChanges();
     }
 }