public async Task <IActionResult> PutAppConfig(int id, AppConfig appConfig) { if (id != appConfig.Id) { return(BadRequest()); } _context.Entry(appConfig).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AppConfigExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutFiles(int id, Files files) { if (id != files.FileId) { return(BadRequest()); } _context.Entry(files).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FilesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PutCategories(int id, Categories category) { if (id != category.CategoryId) { return(BadRequest()); } _context.Entry(category).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoriesExists(id)) { return(NotFound()); } else { throw; } } return(Ok(new { category.CategoryId, category })); }