public async Task <IActionResult> SelectCompany([FromBody] FarmerViewModel companyViewModel) { try { var _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService); var company = _Mapper.Map <Company>(companyViewModel); var result = await _serviceEndPoint.SelectCompany(company); if (result == null) { return(NotFound(companyViewModel)); } return(Ok(new { message = "Succesfully Selected!", result = result })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }