Exemplo n.º 1
0
        public async Task <IActionResult> PostOrCreateCompany([FromBody] CompanyViewModel companyViewModel)
        {
            try
            {
                var  _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService);
                var  company          = _Mapper.Map <Company>(companyViewModel);
                bool result           = await _serviceEndPoint.PostCreateCompany(company);

                if (!result)
                {
                    return(NotFound(companyViewModel));
                }
                return(Ok(new { message = "Succesfully Created!", result = result }));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }