//Gets all keys for a schedule (id = ScheduleID) public KeyPerson[] GetScheduleKey(int id) { var one = scheduleKeyDataRepository.Find(id); List <KeyPerson> list = new List <KeyPerson>(); foreach (ScheduleKey i in one) { var three = personKeyDataRepository.GetPerson(i.KeyID); if (three == null) { KeyPerson user = new KeyPerson(); user.KeyID = i.KeyID; user.Name = "Not Assigned"; list.Add(user); } else { list.Add(three); } } KeyPerson[] output = list.ToArray(); return(output); }
public ScheduleKey[] Get(int id) { return(scheduleKeyDataRepository.Find(id)); }