public async Task <bool> PutImage(int id, Image image) { context.Entry(image).State = EntityState.Modified; try { await context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ImageExists(id)) { return(false); } else { throw; } } return(true); }
public async Task <bool> PutMerchant(int id, Merchant merchant) { context.Entry(merchant).State = EntityState.Modified; try { await context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MerchantExists(id)) { return(false); } else { throw; } } return(true); }