Example #1
0
 public bool Update(long id, Company company)
 {
     company.Id = id;
     try
     {
         _context.Entry(_context.Companies.Find(id)).CurrentValues.SetValues(company);
         return(true);
     }
     catch (Exception ex)
     {
         ErrorMessage = new StringBuilder();
         ErrorMessage = ErrorMessage.Append(ex).Append("Make sure updating item exists.");
     }
     return(false);
 }