示例#1
0
        public async Task<List<Contracts.Models.Facility>> ExecuteAsync(BookFastContext model)
        {
            var facilities = await (from f in model.Facilities
                                    where f.Owner == owner
                                    select f).ToListAsync();

            return mapper.MapFrom(facilities).ToList();
        }
        public async Task <List <Facility> > ExecuteAsync(BookFastContext model)
        {
            var facilities = await(from f in model.Facilities
                                   where f.Owner.Equals(owner, StringComparison.OrdinalIgnoreCase)
                                   select f).ToListAsync();

            return(mapper.MapFrom(facilities).ToList());
        }
 public Task <List <Booking> > ExecuteAsync(BookFastContext model)
 {
     return((from b in model.Bookings
             where b.User.Equals(user, StringComparison.OrdinalIgnoreCase) &&
             b.CanceledOn == null && b.CheckedInOn == null
             select new Booking
     {
         Id = b.Id,
         AccommodationId = b.AccommodationId,
         User = b.User,
         Details = new BookingDetails
         {
             FromDate = b.FromDate,
             ToDate = b.ToDate
         },
         AccommodationName = b.Accommodation.Name,
         FacilityId = b.Accommodation.FacilityId,
         FacilityName = b.Accommodation.Facility.Name,
         StreetAddress = b.Accommodation.Facility.StreetAddress
     }).ToListAsync());
 }
 public FacilityDataSource(BookFastContext context, IFacilityMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
示例#5
0
        public async Task <List <Accommodation> > ExecuteAsync(BookFastContext model)
        {
            var accommodations = await model.Accommodations.Where(a => a.FacilityId == facilityId).ToListAsync();

            return(mapper.MapFrom(accommodations).ToList());
        }
 public AccommodationDataSource(BookFastContext context, IAccommodationMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
 public BookingDataSource(BookFastContext context, IBookingMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }