public Supplier CreateSupplier(Supplier newSupplier) { var newRecord = _dbContext.Suppliers.Add(newSupplier); _dbContext.SaveChanges(); return newRecord; }
public void UpdateSupplier(Supplier supplierToUpdate) { _dbContext.Suppliers.Attach(supplierToUpdate); _dbContext.Entry<Supplier>(supplierToUpdate).State = EntityState.Modified; _dbContext.SaveChanges(); }