Пример #1
0
 private static void GuardAgainstNullGuestTableEntry(string identifier, GuestTableEntry guestTableEntry)
 {
     if (guestTableEntry == null)
     {
         throw new NoGuestFoundException(identifier);
     }
 }
Пример #2
0
        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)
            });
        }