public async Task <IActionResult> Update(StirDTO update) { if (await _settingService.Update(update)) { return(NoContent()); } return(BadRequest($"Updating stir {update.ID} failed on save")); }
public async Task <IActionResult> Create(StirDTO create) { //create.CreatedDate = DateTime.Now; if (await _settingService.Add(create)) { return(NoContent()); } throw new Exception("Creating the Stir failed on save"); }
public async Task <bool> Add(StirDTO model) { try { var stir = _mapper.Map <Stir>(model); _repoStir.Add(stir); return(await _repoStir.SaveAll()); } catch (System.Exception) { throw; } }
public async Task <bool> Update(StirDTO model) { try { var item = await _repoStir.FindAll().FirstOrDefaultAsync(x => x.ID == model.ID); if (item == null) { return(false); } item.RPM = model.RPM; item.Status = model.Status; item.TotalMinutes = model.TotalMinutes; _repoStir.Update(item); return(await _repoStir.SaveAll()); } catch (System.Exception) { throw; } }