Esempio n. 1
0
        internal async Task <RestaurantEntity> Create(RestaurantEntity entity)
        {
            entity.PopulateSearchTag(entity);
            await context.Restaurants.InsertOneAsync(entity);

            return(entity);
        }
Esempio n. 2
0
        public async Task <ReplaceOneResult> Update(RestaurantEntity restaurant)
        {
            var filter = Builders <RestaurantEntity> .Filter.Where(x => x._id == restaurant._id);

            restaurant.PopulateSearchTag(restaurant);
            var updatedRestaurant = await context.Restaurants.ReplaceOneAsync(filter, restaurant);

            return(updatedRestaurant);
        }