Exemplo n.º 1
0
        //Cập nhật Brand
        public async Task <bool> Update(MaterialNameDto model)
        {
            var Line = _mapper.Map <MaterialName>(model);

            _repoLine.Update(Line);
            return(await _repoLine.SaveAll());
        }
Exemplo n.º 2
0
 public async Task <IActionResult> Update(MaterialNameDto update)
 {
     if (await _materialnameService.Update(update))
     {
         return(NoContent());
     }
     return(BadRequest($"Updating model name {update.ID} failed on save"));
 }
Exemplo n.º 3
0
        public async Task <IActionResult> Create(MaterialNameDto create)
        {
            if (_materialnameService.GetById(create.ID) != null)
            {
                return(BadRequest("Line ID already exists!"));
            }
            //create.CreatedDate = DateTime.Now;
            if (await _materialnameService.Add(create))
            {
                return(NoContent());
            }

            throw new Exception("Creating the model name failed on save");
        }