private ICustomerRepository GetRepository() { //var retVal = new DSCustomerClient(service.ServiceUri, new CustomerEntityFactory()); var retVal = new EFCustomerRepository("VirtoCommerce", new CustomerEntityFactory()); return(retVal); }
private ICustomerRepository GetRepository() { EnsureDatabaseInitialized(() => new EFCustomerRepository(_databaseName), () => Database.SetInitializer(new SetupMigrateDatabaseToLatestVersion <EFCustomerRepository, Configuration>())); var retVal = new EFCustomerRepository(_databaseName); return(retVal); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var view = new MainWindow(); var repo = EFCustomerRepository.Create(); var vm = new MainVM(repo, view); view.DataContext = vm; view.Show(); }
public void FindOrdersByCustomerTest() { EFCustomerRepository cr = new EFCustomerRepository(context); EFOrderRepository or = new EFOrderRepository(context); Customer customer = (from o in context.Orders join c in context.Customers on o.Customer.CustomerId equals c.CustomerId select c).First(); var order = filter.FindOrdersByCustomer(customer); Assert.IsTrue(order != null, "Didn't find order"); }
public void Dispose() { try { // Ensure LocalDb databases are deleted after use so that LocalDb doesn't throw if // the temp location in which they are stored is later cleaned. using (var context = new EFCustomerRepository(_databaseName)) { context.Database.Delete(); } } finally { AppDomain.CurrentDomain.SetData("DataDirectory", _previousDataDirectory); } }
public override void Publish(string dbconnection, string data, bool sample, bool reduced, string strategy = SqlDbConfiguration.SqlAzureExecutionStrategy) { base.Publish(dbconnection, data, sample, reduced, strategy); string connection = dbconnection; SafeWriteDebug("ConnectionString: " + connection); using (var db = new EFCustomerRepository(connection)) { if (sample) { SafeWriteVerbose("Running sample scripts"); new SqlCustomerDatabaseInitializer().InitializeDatabase(db); } else { SafeWriteVerbose("Running minimum scripts"); new SetupMigrateDatabaseToLatestVersion <EFCustomerRepository, Configuration>().InitializeDatabase(db); } } }