예제 #1
0
        public UnitOfWork(TravelDbContext _context)
        {
            context = _context;

            this.UserRepository     = new UserRepository(context);
            this.SpotRepository     = new SpotRepository(context);
            this.FeedBackRepository = new FeedBackRepository(context);
        }
예제 #2
0
 public void SetUp()
 {
     _userGuid1 = Guid.NewGuid();
     _userGuid2 = Guid.NewGuid();
     _context   = TravelContextFactory.Create();
     _context.Travels.Add(ArrangeData());
     _context.SaveChanges();
     _handler = new GetTravelQueryHandler(_context);
 }
예제 #3
0
        public static TravelDbContext Create()
        {
            var options = new DbContextOptionsBuilder <TravelDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var context = new TravelDbContext(options);

            context.Database.EnsureCreated();

            return(context);
        }
예제 #4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, TravelDbContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            // Use Authentication
            app.UseAuthentication();

            //app.UseHttpsRedirection();
            app.UseMvc();

            // Create tables
            dbContext.Database.EnsureCreated();
        }
 public TravelRepositoryAsync(TravelDbContext dbContext)
 {
     _dbContext = dbContext;
 }
예제 #6
0
 public CountriesByContinentIdAndLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector)
 {
 }
예제 #7
0
 public MenuDAO()
 {
     db = new TravelDbContext();
 }
예제 #8
0
        private static TravelDbContext TravelContext()
        {
            var context = new TravelDbContext();

            return(context);
        }
 public AccommodationDetailByIdAndLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector)
 {
 }
 private TravelDbContext db;//= new TravelDbContext();
 public ExperiencesController(TravelDbContext context)
 {
     db = context;
 }
예제 #11
0
 public ThemeDAO()
 {
     db = new TravelDbContext();
 }
 public AdminRepository(TravelDbContext context)
 {
     _context = context;
 }
 public RoomPhotosByAccommodationIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector)
 {
 }
 public DiscountDAO()
 {
     db = new TravelDbContext();
 }
 public UserDAO()
 {
     db = new TravelDbContext();
 }
예제 #16
0
 public SuggestionsOfRegionByTermAndLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector)
 {
 }
 public SystemNotificationDAO()
 {
     db = new TravelDbContext();
 }
 public SystemConfigDAO()
 {
     db = new TravelDbContext();
 }
 public VisitorDAO()
 {
     db = new TravelDbContext();
 }
 public FeedBackDAO()
 {
     db = new TravelDbContext();
 }
 public DomainDAO()
 {
     db = new TravelDbContext();
 }
예제 #22
0
 public ContinentsByLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector)
 {
 }
예제 #23
0
 public RoomsByAccommodationIdAndLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector)
 {
 }
예제 #24
0
 public AirportRepository(TravelDbContext dbContext) : base(dbContext)
 {
 }
 public ProductCategoryDAO()
 {
     db = new TravelDbContext();
 }
 public ContentRepository(TravelDbContext context)
 {
     _context = context;
 }
예제 #27
0
        public static void Destroy(TravelDbContext context)
        {
            context.Database.EnsureDeleted();

            context.Dispose();
        }
예제 #28
0
 protected TravelQueryHandler(TravelDbContext context, IProjection projector) : base(projector)
 {
     Context = context;
 }
 public TourPackagesController(TravelDbContext context)
 {
     _context = context;
 }
예제 #30
0
 public GenericRepositoryAsync(TravelDbContext dbContext)
 {
     _dbContext = dbContext;
 }