public UnitOfWork(TravelDbContext _context) { context = _context; this.UserRepository = new UserRepository(context); this.SpotRepository = new SpotRepository(context); this.FeedBackRepository = new FeedBackRepository(context); }
public void SetUp() { _userGuid1 = Guid.NewGuid(); _userGuid2 = Guid.NewGuid(); _context = TravelContextFactory.Create(); _context.Travels.Add(ArrangeData()); _context.SaveChanges(); _handler = new GetTravelQueryHandler(_context); }
public static TravelDbContext Create() { var options = new DbContextOptionsBuilder <TravelDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; var context = new TravelDbContext(options); context.Database.EnsureCreated(); return(context); }
// 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; }
public CountriesByContinentIdAndLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector) { }
public MenuDAO() { db = new TravelDbContext(); }
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; }
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(); }
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(); }
public ContinentsByLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector) { }
public RoomsByAccommodationIdAndLanguageIdQueryHandler(TravelDbContext context, IProjection projector) : base(context, projector) { }
public AirportRepository(TravelDbContext dbContext) : base(dbContext) { }
public ProductCategoryDAO() { db = new TravelDbContext(); }
public ContentRepository(TravelDbContext context) { _context = context; }
public static void Destroy(TravelDbContext context) { context.Database.EnsureDeleted(); context.Dispose(); }
protected TravelQueryHandler(TravelDbContext context, IProjection projector) : base(projector) { Context = context; }
public TourPackagesController(TravelDbContext context) { _context = context; }
public GenericRepositoryAsync(TravelDbContext dbContext) { _dbContext = dbContext; }