public void Add(RegisteredVehicle vehicle) { DataContext1 context = new DataContext1(); context.RegisteredVehicles.Add(vehicle); context.SaveChanges(); }
public UnitOfWork(DataContext1 dataContext1, DataContext2 dataContext2) { _dataContext1 = dataContext1; _dataContext2 = dataContext2; UserRepository = new UserRepository(dataContext1); ProductRepository = new ProductRepository(dataContext2); }
public void Delete(Manufacturer manufacturer) { DataContext1 context = new DataContext1(); context.Manufacturers.Remove(manufacturer); context.SaveChanges(); }
public DbSet <RegisteredVehicle> CollectRegisteredVehicleList() { DataContext1 context = new DataContext1(); var list = context.RegisteredVehicles; return(list); }
public RegisteredVehicle Find(Guid id) { DataContext1 context = new DataContext1(); var item = context.RegisteredVehicles.First <RegisteredVehicle>(m => m.Id == id); return(item); }
public void AddManufacturer(Manufacturer manufacturer) { DataContext1 context = new DataContext1(); context.Manufacturers.Add(manufacturer); context.SaveChanges(); }
public void Add(Category category) { DataContext1 context = new DataContext1(); context.Categories.Add(category); context.SaveChanges(); }
public Category Find(Guid id) { DataContext1 context = new DataContext1(); var item = context.Categories.First <Category>(m => m.Id == id); return(item); }
public void Update(Manufacturer manfacturer) { DataContext1 context = new DataContext1(); var found = context.Manufacturers.First(m => m.Id == manfacturer.Id); found.Name = manfacturer.Name; context.SaveChanges(); }
public void Delete(Guid id) { DataContext1 context = new DataContext1(); var item = context.RegisteredVehicles.First(m => m.Id == id); context.Remove(item); context.SaveChanges(); }
public void Delete(Guid id) { DataContext1 context = new DataContext1(); var item = Find(id); context.Categories.Remove(item); context.SaveChanges(); }
public void Update(RegisteredVehicle vehicle) { DataContext1 context = new DataContext1(); var item = Find(vehicle.Id); item = vehicle; context.Update(item); context.SaveChanges(); }
public List <Manufacturer> CollectManufacturerList() { DataContext1 context = new DataContext1(); List <Manufacturer> list = new List <Manufacturer>(); list = context.Manufacturers.OrderBy(m => m.Name).ToList(); return(list); }
public Manufacturer Find(Guid id) { DataContext1 context = new DataContext1(); var foundManufacturer = new Manufacturer(); foundManufacturer = context.Manufacturers.First <Manufacturer>(m => m.Id == id); return(foundManufacturer); }
public void Update(Category category) { DataContext1 context = new DataContext1(); var item = Find(category.Id); item = category; context.Update(item); context.SaveChanges(); }
public List <Category> CollectCategoryList() { DataContext1 context = new DataContext1(); List <Category> result = new List <Category>(); result = context.Categories.OrderBy(m => m.StartRange).ToList(); return(result); }
public UnitOfWork(DataContext1 dataContext1, DataContext2 dataContext2, DataContext3 dataContext3) { _dataContext1 = dataContext1; _dataContext2 = dataContext2; _dataContext3 = dataContext3; UserRepository = new UserRepository(dataContext1); UserLogRepository = new UserLogRepository(dataContext2); CategoryRepository = new CategoryRepository(dataContext3); ProductRepository = new ProductRepository(dataContext3); }
static void Main() { using (var db = new DataContext()) { db.Database.Migrate(); } using (var db1 = new DataContext1()) { db1.Database.Migrate(); } ConfigureServices(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); LoginForm = new LoginForm(); Application.Run(LoginForm); }
public BuildReal() { this.DataContext = new DataContext1(); }
public SellingContentsRep1(DataContext1 context) { _context = context; }
public ItemRep1(DataContext1 context) { _context = context; }
public EmployeeRep1(DataContext1 context) { _context = context; }