public VehiclePerformanceThresholdModel(VehiclePerformanceThreshold item, string provider) { id = item.Id; providerId = provider; serverTime = DateTimeOffset.UtcNow; activeFrom = item.activeFrom; activeTo = item.activeTo; rpmOverValue = item.rpmOverValue; overSpeedValue = item.overSpeedValue; excessSpeedValue = item.excessSpeedValue; longIdleValue = item.longIdleValue; hiThrottleValue = item.hiThrottleValue; }
public ActionResult <VehiclePerformanceThresholdModel> PerformanceThreshold(string id) { if (Guid.TryParse(id, out var guid)) { VehiclePerformanceThreshold data = m_Context.VehiclePerformanceThreshold.FirstOrDefault(c => c.Id == guid); if (data != null) { return(new VehiclePerformanceThresholdModel(data, m_appSettings.ProviderId)); } else { return(NotFound("id Not Found")); } } return(BadRequest("Invalid id")); }