Exemplo n.º 1
0
        public static KodkodDbContext GetEmptyDbContext()
        {
            var optionsBuilder = new DbContextOptionsBuilder <KodkodDbContext>();

            optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
            optionsBuilder.UseLazyLoadingProxies();

            var inMemoryContext = new KodkodDbContext(optionsBuilder.Options);

            return(inMemoryContext);
        }
Exemplo n.º 2
0
 public TestBase()
 {
     // disable automapper static registration
     ServiceCollectionExtensions.UseStaticRegistration = false;
     // Initialize mapper
     Mapper = new Mapper(
         new MapperConfiguration(
             configure => { configure.AddProfile<ApplicationMappingProfile>(); }
         )
     );
     Client = GetTestServer();
     _testUserFormData = new Dictionary<string, string>
     {
         {"email", "*****@*****.**"},
         {"username", "testuser"},
         {"password", "123qwe"}
     };
     KodkodInMemoryContext = GetInitializedDbContext();
     ContextUser = GetContextUser();
 }
Exemplo n.º 3
0
 public Repository(KodkodDbContext dbContext)
 {
     DbContext = dbContext;
     DbSet     = DbContext.Set <TEntity>();
 }
Exemplo n.º 4
0
 public KodkodDbContextActionFilter(KodkodDbContext context)
 {
     _context = context;
 }