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