Esempio n. 1
0
        public void Update(TypeUpdateDto dto)
        {
            var productType = Get(dto.Id);

            if (productType == null)
            {
                throw new System.Exception("Unit not found");
            }
            productType.Code        = dto.Code;
            productType.Description = dto.Description;
            base.Update(productType);
        }
 public IActionResult Update([FromBody] TypeUpdateDto request)
 {
     try
     {
         _service.Update(request);
         return(Ok());
     }
     catch (Exception e)
     {
         _logger.LogError(-1, e, String.Format(LogErrorText, e.Message));
         return(BadRequest(String.Format(BadRequestText, "updating type")));
     }
 }