public UnitOfWork(DataContext context) { _context = context; Stores = new StoreRepository(_context); Products = new ProductRepository(_context); HasA = new HasARepository(_context); }
public void SetUp() { _prod = new Product() {ProductName = "TestProduct"}; _store = new Store() { StoreName = "TestStore" }; _hasA = new HasA() {Price = 10}; _context = new DataContext(); _hasARepository = new HasARepository(_context); _context.Database.Connection.ConnectionString = "Server=.\\SQLEXPRESS;Database=Pristjek220Data.DataContext; Trusted_Connection=True;"; _context.Database.ExecuteSqlCommand("dbo.TestCleanTable"); }