Пример #1
0
        public async Task <bool> UpdateRecipe(ReceipeModel receipeModel)
        {
            var result = await receipeCollection.ReplaceOneAsync <ReceipeModel>(receipe => receipe.ReceipeID == receipeModel.ReceipeID,
                                                                                receipeModel);

            return(result.IsAcknowledged);
        }
Пример #2
0
        public async Task <bool> RemoveReceipe(ReceipeModel receipeModel)
        {
            var result = await receipeCollection.DeleteOneAsync <ReceipeModel>(receipe => receipe.ReceipeID == receipeModel.ReceipeID);

            return(result.IsAcknowledged);
        }
Пример #3
0
        public async Task <ReceipeModel> CreateReceipeAsync(ReceipeModel receipeModel)
        {
            await receipeCollection.InsertOneAsync(receipeModel);

            return(receipeModel);
        }