//Gets all keys for a person (id = personID) public KeyPerson[] GetLockKey(int id) { var one = lockKeyDataRepository.Find(id); List <KeyPerson> list = new List <KeyPerson>(); foreach (LockKey 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 LockKey[] Get(int id) { return(lockKeyDataRepository.Find(id)); }