private static void GuardAgainstNullGuestTableEntry(string identifier, GuestTableEntry guestTableEntry) { if (guestTableEntry == null) { throw new NoGuestFoundException(identifier); } }
private static Guest BuildGuestFrom(GuestTableEntry guestTableEntry, IEnumerable <ExtraTableEntry> extrasTableEntries) { Enum.TryParse(guestTableEntry.Status, out GuestStatus status); return(new Guest { Id = guestTableEntry.Id, Name = guestTableEntry.Name, MaxExtras = guestTableEntry.TotalExtras, Status = status, Extras = extrasTableEntries.Select(e => e.Name) }); }