public string Insert(Customer customer) { using (var dbContext = new NorthwindEntities()) { dbContext.Customers.Add(customer); dbContext.SaveChanges(); return customer.CustomerID; } }
public string Insert(string customerID, string companyName) { using(var dbContext = new NorthwindEntities()) { var customer = new Customer() { CustomerID = customerID, CompanyName = companyName, }; dbContext.Customers.Add(customer); dbContext.SaveChanges(); return customer.CustomerID; } }