public async Task <bool> Update(ArticleNoDto model) { var articleNo = _mapper.Map <ArticleNo>(model); _repoArticalNo.Update(articleNo); return(await _repoArticalNo.SaveAll()); }
public async Task <IActionResult> Update(ArticleNoDto update) { if (await _articleNoService.Update(update)) { return(NoContent()); } return(BadRequest($"Updating the article no {update.ID} failed on save")); }
public async Task <IActionResult> Create(ArticleNoDto create) { if (_articleNoService.GetById(create.ID) != null) { return(BadRequest("Article ID already exists!")); } create.CreatedDate = DateTime.Now; if (await _articleNoService.Add(create)) { return(NoContent()); } throw new Exception("Creating the article no failed on save"); }