public IHttpActionResult GetAllEmployeesLatestLocation(DateTime currentDate) { try { using (MaxMasterDbEntities db = new MaxMasterDbEntities()) { var EmployeesLatestLocation = db.GetEmployeesLatestLocation(currentDate).ToList(); return(Content(HttpStatusCode.OK, new { EmployeesLatestLocation })); } } catch (Exception ex) { new Error().logAPIError(System.Reflection.MethodBase.GetCurrentMethod().Name, ex.ToString(), ex.StackTrace); return(Content(HttpStatusCode.InternalServerError, "An error occured, please try again later")); } }