コード例 #1
0
 private static List <CeremonyGuestQueryModel> MapCeremonyGuests(List <CeremonyGuest> ceremonyGuests)
 {
     return(ceremonyGuests.Select(x => new CeremonyGuestQueryModel
     {
         Id = x.Id,
         CeremonyId = x.CeremonyId,
         GuestId = x.GuestId,
         Guest = x.Guest.FullName,
         GuestType = GuestTypes.GetGuestType(x.Guest.GuestType)
     }).ToList());
 }
コード例 #2
0
        public List <GuestViewModel> Search(GuestSearchModel searchModel)
        {
            var query = _hContext.Guests.Select(x => new GuestViewModel
            {
                Id          = x.Id,
                FullName    = x.FullName,
                Tel         = x.Tel,
                GuestType   = GuestTypes.GetGuestType(x.GuestType),
                Image       = x.Image,
                Coordinator = x.Coordinator
            });

            if (!string.IsNullOrWhiteSpace(searchModel.FullName))
            {
                query = query.Where(x => x.FullName.Contains(searchModel.FullName));
            }

            return(query.OrderByDescending(x => x.Id).ToList());
        }
コード例 #3
0
        public List <GuestViewModel> GetGuests(long id = 0)
        {
            var guestInfo = _hContext.Guests.Select(x => new GuestViewModel
            {
                Id          = x.Id,
                GuestType   = GuestTypes.GetGuestType(x.GuestType),
                FullName    = x.FullName,
                Image       = x.Image,
                Tel         = x.Tel,
                Email       = x.Email,
                Coordinator = x.Coordinator
            });

            if (id != 0)
            {
                guestInfo = guestInfo.Where(x => x.Id == id);
            }
            return(guestInfo.ToList());
        }
コード例 #4
0
        private static List <CeremonyGuestViewModel> MapGuests(List <CeremonyGuest> ceremonyGuests)
        {
            var guests = new List <CeremonyGuestViewModel>();

            foreach (var item in ceremonyGuests)
            {
                var gst = new CeremonyGuestViewModel
                {
                    Id            = item.CeremonyId,
                    CeremonyId    = item.CeremonyId,
                    GuestId       = item.GuestId,
                    GuestType     = GuestTypes.GetGuestType(item.Guest.GuestType),
                    Guest         = item.Guest.FullName,
                    GuestPic      = item.Guest.Image,
                    Satisfication = item.Satisfication
                };
                guests.Add(gst);
            }
            return(guests);
        }
コード例 #5
0
 public VirtualMachineConfiguration SetGuestType(GuestTypes guestType)
 {
   _guestType = guestType;
   return this;
 }