public ServiceShiftTypeController(AppContext context)
        {
            var query = context.ServiceShifts
                        .Join(
                context.ServiceTypes,
                serviceShifts => serviceShifts.ServId,
                serviceTypes => serviceTypes.ServId,
                (serviceShift, serviceType) => new
            {
                Id           = serviceShift.ServId,
                Title        = serviceType.ServTitle,
                Location     = serviceShift.SerLocation,
                DayOfTheWeek = serviceShift.DayOfWeek,
                StartTime    = serviceShift.TimeStart,
                EndTime      = serviceShift.TimeEnd
            }
                ).ToList();

            serviceShiftTypeList = new List <ServiceShiftType>();
            serviceIdTitleList   = new List <ServiceShiftType>();
            serLocationList      = new List <string>();
            dayOfWeekList        = new List <DayOfWeek>();
            startToEndTimeList   = new List <string>();

            for (int i = 0; i < query.Count; i++)
            {
                // calls all parameter constructor
                ServiceShiftType serviceShiftType = new ServiceShiftType(query[i].Id, query[i].Title, query[i].Location, query[i].DayOfTheWeek, query[i].StartTime, query[i].EndTime);
                // calls two parameter constructor
                ServiceShiftType serviceIdTitle = new ServiceShiftType(query[i].Id, query[i].Title);

                // populates all the lists
                serviceIdTitleList.Add(serviceIdTitle);
                serviceShiftTypeList.Add(serviceShiftType);
                serLocationList.Add(serviceShiftType.location);
                dayOfWeekList.Add(serviceShiftType.dayOfWeek);
                startToEndTimeList.Add(serviceShiftType.startToEndTime);
            }

            // ServiceShiftType list that holds every element
            serviceShiftTypeList = serviceShiftTypeList.Distinct().ToList();

            // ServiceShiftType list that holds id and serTitle
            // uses custom Distinct method
            serviceIdTitleList = serviceIdTitleList.Distinct(new DistinctItemComparer()).ToList();

            // string list that holds location
            serLocationList = serLocationList.Distinct().ToList();

            // DayOfWeek list that holds days
            dayOfWeekList = dayOfWeekList.Distinct().ToList();

            // string list that holds startTime - endTime
            startToEndTimeList = startToEndTimeList.Distinct().ToList();
        }
        // Get the first ServiceShiftType
        private ServiceShiftType GetServiceShiftTypeDetails()
        {
            var query = _context.ServiceShifts
                        .Join(
                _context.ServiceTypes,
                serviceShifts => serviceShifts.ServId,
                serviceTypes => serviceTypes.ServId,
                (serviceShift, serviceType) => new
            {
                Id           = serviceShift.ServId,
                Title        = serviceType.ServTitle,
                Location     = serviceShift.SerLocation,
                DayOfTheWeek = serviceShift.DayOfWeek,
                StartTime    = serviceShift.TimeStart,
                EndTime      = serviceShift.TimeEnd
            }
                ).ToList();

            ServiceShiftType serviceAppointment = new ServiceShiftType(query[0].Id, query[0].Title, query[0].Location, query[0].DayOfTheWeek, query[0].StartTime, query[0].EndTime);

            return(serviceAppointment);
        }