Exemple #1
0
        public async Task <bool> UpdateAsync(ChemicalUpdateDto model)
        {
            var chemical = _mapper.Map <Chemical>(model);

            chemical.CreatedDate = DateTime.Now;
            _repoChemical.Update(chemical);
            return(await _repoChemical.SaveAll());
        }
 public async Task <IActionResult> Update(ChemicalUpdateDto update)
 {
     if (await _chemicalService.UpdateAsync(update))
     {
         return(NoContent());
     }
     return(BadRequest($"Updating Kind {update.ID} failed on save"));
 }