public void Add(Restaurant restaurant) { //this statement will check the constraints in the db class db.Restaurants.Add(restaurant); //commit changes, by creating an insert statement db.SaveChanges(); }
public void Add(Restaurant restaurant) { //we add the data to be saved as a parameter db.Restaurants.Add(restaurant); //Here we commit the changes db.SaveChanges(); }
public void Add(Restaurant restaurant) { db.Restaurants.Add(restaurant); // commit changes db.SaveChanges(); }
public void Add(Restaurant restaurant) { // it is not added yet, this is just unit of work // kinda like a transaction db.Restaurants.Add(restaurant); // next step saves it db.SaveChanges(); }
public int Add(RestaurantViewModel restaurantViewModel) { Restaurant restaurant = new Restaurant(); //restaurant.Name = restaurantViewModel.Name; //restaurant.WeighterId = restaurantViewModel.selectedWeighterId; //restaurant.Cuisine = restaurantViewModel.Cuisine; restaurant = AutoMapper.Mapper.Map <RestaurantViewModel, Restaurant>(restaurantViewModel); restaurant.Id = db.Restaurants.Max(r => r.Id) + 1; db.Restaurants.Add(restaurant); db.SaveChanges(); return(restaurant.Id); }
public void Add(Restaurant restaurant) { db.Restaurants.Add(restaurant); db.SaveChanges(); }
public Restaurant Add(Restaurant restaurant) { _context.Restaurants.Add(restaurant); _context.SaveChanges(); return(restaurant); }
public void Create(Restaurant restaurant) { dbContext.Restaurants.Add(restaurant); dbContext.SaveChanges(); }
public void Add(Restaurant restaurant) { dbContext.Restaurants.Add(restaurant); dbContext.SaveChanges(); // This is the point where it gets added. }
public void AddRestaurant(Restaurant restaurant) { database.Restaurants.Add(restaurant); database.SaveChanges(); }
public void Create(RestaurantModel restaurant) { db.Restaurants.Add(restaurant); db.SaveChanges(); }
public void Add(Restaurant restaurant) { // id will be the primary key and it will be the identity column db.Restaurants.Add(restaurant); db.SaveChanges(); // commit to database }
void IRestaurantData.Add(Restaurant restaurant) { db.Restaurants.Add(restaurant); db.SaveChanges(); }
public void Add(Restaurant restaurant) { db.Restaurants.Add(restaurant); db.SaveChanges(); // insert into db }
public void Add(Restaurant restaurant) { db.Restaurants.Add(restaurant); db.SaveChanges(); //this will commint the changes into the DB by executing an Inster intreuction }
public void Add(Restaurant restaurant) { context.Restaurants.Add(restaurant); context.SaveChanges(); }