private List <DSS.Models.TimeSlotVM> GetTimeSlots() { ITimeSlotService timeSlotService = DependencyUtils.Resolve <ITimeSlotService>(); var TimeSlotList = timeSlotService.Get().ToList(); var TimeSlotVMs = new List <DSS.Models.TimeSlotVM>(); if (TimeSlotList != null) { foreach (var item in TimeSlotList) { var timeSlotVM = new DSS.Models.TimeSlotVM { SlotID = item.SlotID, StartTime = item.StartTime.ToString(), EndTime = item.EndTime.ToString(), }; TimeSlotVMs.Add(timeSlotVM); } } return(TimeSlotVMs); }