//Cập nhật Brand public async Task <bool> Update(ModelNoDto model) { var ModelNo = _mapper.Map <ModelNo>(model); _repoModelNo.Update(ModelNo); return(await _repoModelNo.SaveAll()); }
//Cập nhật Brand public async Task <bool> Update(ModelNoDto model) { var Line = _mapper.Map <ModelNo>(model); _repoLine.Update(Line); return(await _repoLine.SaveAll()); }
public async Task <IActionResult> Update(ModelNoDto update) { if (await _modelNoService.Update(update)) { return(NoContent()); } return(BadRequest($"Updating model no {update.ID} failed on save")); }
public async Task <IActionResult> Create(ModelNoDto create) { if (_modelNoService.GetById(create.ID) != null) { return(BadRequest("Model No ID already exists!")); } if (await _modelNoService.Add(create)) { return(NoContent()); } throw new Exception("Creating the model no failed on save"); }