Ejemplo n.º 1
0
 public async Task <IActionResult> Put(CompanyDTO companyDTO)
 {
     try
     {
         if (!ModelState.IsValid)
         {
             return(BadRequest(Messages.InvalidModel));
         }
         if (!(await _company.CheckCompanyExist(companyDTO.CompanyId)))
         {
             return(BadRequest(Messages.CompanyNotExist));
         }
         return(Ok(await _company.Put(companyDTO)));
     }
     catch (Exception ex)
     {
         return(BadRequest(Messages.GeneralError));
     }
 }