internal async Task <RestaurantEntity> Create(RestaurantEntity entity) { entity.PopulateSearchTag(entity); await context.Restaurants.InsertOneAsync(entity); return(entity); }
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); }