예제 #1
0
파일: BlogEntryDAL.cs 프로젝트: blel/ebalit
 public int CreateBlogEntry(BlogEntry blogEntry)
 {
     base.EbalitDBContext.BlogEntries.Add(blogEntry);
     base.EbalitDBContext.SaveChanges();
     return blogEntry.Id;
 }
예제 #2
0
파일: BlogEntryDAL.cs 프로젝트: blel/ebalit
 public void DeleteBlogEntry(BlogEntry blogEntry)
 {
     base.EbalitDBContext.BlogEntries.Attach(blogEntry);
     base.EbalitDBContext.BlogEntries.Remove(blogEntry);
     base.EbalitDBContext.SaveChanges();
 }
예제 #3
0
파일: BlogEntryDAL.cs 프로젝트: blel/ebalit
 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();
     }
 }