public DriverPerformanceSummaryModel(DriverPerformanceSummary item, string provider) { id = item.Id; providerId = provider; serverTime = DateTimeOffset.UtcNow; driverId = item.driverId; eventEnd = item.eventEnd; eventStart = item.eventStart; distance = item.distance; fuel = item.fuel; cruiseTime = item.cruiseTime; engineLoadPercent = item.engineLoadPercent; overRpmTime = item.overRpmTime; brakeEvents = item.brakeEvents; }
public ActionResult <DriverPerformanceSummaryModel> DriverPerformanceSummary(string id) { if (Guid.TryParse(id, out var guid)) { DriverPerformanceSummary data = m_Context.DriverPerformanceSummary.FirstOrDefault(c => c.Id == guid); if (data != null) { return(new DriverPerformanceSummaryModel(data, m_appSettings.ProviderId)); } else { return(NotFound("id Not Found")); } } return(BadRequest("Invalid id")); }