Exemplo n.º 1
0
 public static Type ToEntity(this TypeCreationDto dto)
 {
     return(new Type
     {
         Description = dto.Description,
         Code = dto.Code
     });
 }
Exemplo n.º 2
0
 public IActionResult Add([FromBody] TypeCreationDto request)
 {
     try
     {
         _service.Add(request.ToEntity());
         return(Ok());
     }
     catch (Exception e)
     {
         _logger.LogError(-1, e, String.Format(LogErrorText, e.Message));
         return(BadRequest(String.Format(BadRequestText, "adding type")));
     }
 }