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