コード例 #1
0
 public void Update(Article item)
 {
     // Check there's not an object with same identifier already in context
     if (_context.Articles.Local.Select(x => x.Id == item.Id).Any())
     {
         throw new ApplicationException("Object already exists in context");
     }
     _context.Entry(item).State = EntityState.Modified;
 }