Esempio n. 1
0
        internal UniformConfigurator RegisterInMemoryUniform(IContainer container)
        {
            UniformContext uniformContext = new InMemoryContext();
            container.Configure(config => config.For<UniformContext>().Singleton().Use(uniformContext));

            return this;
        }
Esempio n. 2
0
 public static RoleManager<IdentityRole> CreateRoleManager(InMemoryContext context)
 {
     var services = new ServiceCollection();
     services.AddIdentity<IdentityUser, IdentityRole>();
     services.AddInstance<IRoleStore<IdentityRole>>(new RoleStore<IdentityRole>(context));
     return services.BuildServiceProvider().GetRequiredService<RoleManager<IdentityRole>>();
 }
Esempio n. 3
0
        public static InMemoryContext CreateContext()
        {
            var services = new ServiceCollection();
            services.AddEntityFramework().AddInMemoryDatabase();
            var serviceProvider = services.BuildServiceProvider();

            var db = new InMemoryContext();
            db.Database.EnsureCreated();

            return db;
        }
Esempio n. 4
0
 public static UserManager<InMemoryUser> CreateManager(InMemoryContext context)
 {
     return MockHelpers.CreateManager<InMemoryUser>(() => new InMemoryUserStore<InMemoryUser>(context));
 }
Esempio n. 5
0
 public UnitOfWorkMem()
 {
     context            = new InMemoryContext();
     CustomerRepository = new CustomerRepositoryEFMemory(context);
 }
Esempio n. 6
0
 public InMemoryUsersRepository(InMemoryContext context)
 {
     this.context = context;
 }
Esempio n. 7
0
 public GenreRepositoryInEF(InMemoryContext context)
 {
     this.context = context;
 }
Esempio n. 8
0
 public VideoRepositoryEFMemory(InMemoryContext context)
 {
     this.context = context;
 }
Esempio n. 9
0
 public ProfileRepositoryShould()
 {
     _context    = new InMemoryContext();
     _repository = new ProfileRepository(_context);
 }
Esempio n. 10
0
 public BloggerController(InMemoryContext memoryContext)
 {
     this.memoryContext = memoryContext;
 }
Esempio n. 11
0
 public GenreRepository(InMemoryContext context)
 {
     _context = context;
 }
Esempio n. 12
0
 public GenericEntityRepositoryTests()
 {
     _fooRepository = new GenericEntityRepository <Foo>(null);
     _context       = InMemoryContext.Create();
     _fooRepository.SetContext(_context);
 }
 public InMemoryTrainingRepository(InMemoryContext context)
 {
     this.context = context;
 }
Esempio n. 14
0
        public InternalDbService()
        {
            var optionBuilder = new DbContextOptionsBuilder().UseInMemoryDatabase("InMemoryDb");;

            _DbInMemoryContext = new InMemoryContext(optionBuilder.Options);
        }
Esempio n. 15
0
 public UnitOfWorkMem()
 {
     context             = new InMemoryContext();
     UserEventRepository = new UserEventRepositoryEFMemory(context);
 }
Esempio n. 16
0
        public void Inititalize()
        {
            var optionBuilder = new DbContextOptionsBuilder().UseInMemoryDatabase("InMemoryDb");;

            DbContext = new InMemoryContext(optionBuilder.Options);
        }
Esempio n. 17
0
 public static RoleManager<IdentityRole> CreateRoleManager(InMemoryContext context)
 {
     var services = CreateTestServices();
     services.AddSingleton<IRoleStore<IdentityRole>>(new RoleStore<IdentityRole>(context));
     return services.BuildServiceProvider().GetRequiredService<RoleManager<IdentityRole>>();
 }
Esempio n. 18
0
 public UnitOfWorkMem()
 {
     context = new InMemoryContext();
     VidRepo = new VidRepoEFMemory(context);
 }
Esempio n. 19
0
 public AddBookView()
 {
     InitializeComponent();
     _context = InMemoryContext.Instance;
 }
Esempio n. 20
0
        public virtual void RestoreData()
        {
            InMemoryContext context = (InMemoryContext)this.CurrentDataSource;

            context.RestoreData();
        }