public async Task <IActionResult> DeleteLocation([FromBody] LocationViewModel locationViewModel) { try { var _serviceEndPoint = new ServicesEndPoint(_unitOfWork, _emailService); var location = _Mapper.Map <Location>(locationViewModel); bool result = await _serviceEndPoint.DeleteLocation(location); if (!result) { return(NotFound(locationViewModel)); } return(Ok(new { message = "Succesfully Deleted!", result = result })); } catch (Exception ex) { return(BadRequest(ex.Message)); } }