Пример #1
0
        private DbSet <T> _context; // field yarattik ve generic T'yi _context icine gonderdik

        public BaseService()
        {
            db       = new BookStoreEntities();
            _context = db.Set <T>();
        }
 private void CreateMockOfRepository()
 {
     _bookStoreEntities = Substitute.For <BookStoreEntities>();
     _bookStoreEntities.Set <T>().Returns(mockDbSet);
     Repository = new EFGenericRepository <T>(_bookStoreEntities);
 }
Пример #3
0
 public void SetUp()
 {
     _bookEntities = Substitute.For <BookStoreEntities>();
     _bookEntities.Set <Book>().Returns(BookFake.GetBookDbSet());
     _repository = new EFGenericRepository <Book>(_bookEntities);
 }