//Cập nhật Brand public async Task <bool> Update(MaterialNameDto model) { var Line = _mapper.Map <MaterialName>(model); _repoLine.Update(Line); return(await _repoLine.SaveAll()); }
public async Task <IActionResult> Update(MaterialNameDto update) { if (await _materialnameService.Update(update)) { return(NoContent()); } return(BadRequest($"Updating model name {update.ID} failed on save")); }
public async Task <IActionResult> Create(MaterialNameDto create) { if (_materialnameService.GetById(create.ID) != null) { return(BadRequest("Line ID already exists!")); } //create.CreatedDate = DateTime.Now; if (await _materialnameService.Add(create)) { return(NoContent()); } throw new Exception("Creating the model name failed on save"); }