public static bool CreateRestaurantScopeIsValid(this _Restaurant restaurant)
 {
     return(AssertionConcern.IsSatisfiedBy
            (
                AssertionConcern.AssertNotNull(restaurant.RestaurantName, "O nome do restaurante é obrigatório")
            ));
 }
        public _Restaurant Create(CreateRestaurantCommand command)
        {
            var restaurant = new _Restaurant(command.RestaurantName);

            restaurant.Create();
            _repository.Create(restaurant);

            if (Commit())
            {
                return(restaurant);
            }

            return(null);
        }
 public void Update(_Restaurant restaurant)
 {
     _context.Entry <_Restaurant>(restaurant).State = EntityState.Modified;
 }
 public void Remove(_Restaurant restaurant)
 {
     _context.Restaurants.Remove(restaurant);
 }
 public void Create(_Restaurant restaurant)
 {
     _context.Restaurants.Add(restaurant);
 }