public void Add(RegisteredVehicle vehicle) { DataContext1 context = new DataContext1(); context.RegisteredVehicles.Add(vehicle); context.SaveChanges(); }
public void Add(Category category) { DataContext1 context = new DataContext1(); context.Categories.Add(category); context.SaveChanges(); }
public void Delete(Manufacturer manufacturer) { DataContext1 context = new DataContext1(); context.Manufacturers.Remove(manufacturer); context.SaveChanges(); }
public void AddManufacturer(Manufacturer manufacturer) { DataContext1 context = new DataContext1(); context.Manufacturers.Add(manufacturer); 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(Manufacturer manfacturer) { DataContext1 context = new DataContext1(); var found = context.Manufacturers.First(m => m.Id == manfacturer.Id); found.Name = manfacturer.Name; context.SaveChanges(); }
public void Update(RegisteredVehicle vehicle) { DataContext1 context = new DataContext1(); var item = Find(vehicle.Id); item = vehicle; context.Update(item); context.SaveChanges(); }
public void Update(Category category) { DataContext1 context = new DataContext1(); var item = Find(category.Id); item = category; context.Update(item); context.SaveChanges(); }
public int Complete() { return(_dataContext1.SaveChanges()); }