예제 #1
0
        public async Task <bool> Update(ArtProcessDto model)
        {
            var artProcess = _mapper.Map <ArtProcess>(model);

            _repoArticalNo.Update(artProcess);
            return(await _repoArticalNo.SaveAll());
        }
예제 #2
0
 public async Task <IActionResult> Update(ArtProcessDto update)
 {
     if (await _artProcessService.Update(update))
     {
         return(NoContent());
     }
     return(BadRequest($"Updating the article no {update.ID} failed on save"));
 }
예제 #3
0
        public async Task <IActionResult> Create(ArtProcessDto create)
        {
            if (_artProcessService.GetById(create.ID) != null)
            {
                return(BadRequest("Article ID already exists!"));
            }
            if (await _artProcessService.Add(create))
            {
                return(NoContent());
            }

            throw new Exception("Creating the article no failed on save");
        }