Esempio n. 1
0
        private TmDbContext GetContext()
        {
            var options = new DbContextOptionsBuilder <TmDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var dataContext = new TmDbContext(options);

            dataContext.Database.EnsureCreated();
            return(dataContext);
        }
Esempio n. 2
0
        public ProjectRepositoryTest()
        {
            _projects = new List <Project>
            {
                new Project {
                    Id = "1", Name = "P1"
                },
                new Project {
                    Id = "2", Name = "P2"
                },
                new Project {
                    Id = "3", Name = "P3"
                }
            };

            _dataContext = GetContext();
            _unitOfWork  = new UnitOfWork(_dataContext);
        }
Esempio n. 3
0
 public UnitOfWork(TmDbContext context)
 {
     _context = context;
 }
Esempio n. 4
0
 public Repository(TmDbContext context)
 {
     Context = context;
 }