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

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