예제 #1
0
        public async Task <bool> UpdatePost(Post postToUpdate)
        {
            var cosmosPost = new CosmosPostDTO
            {
                Id   = postToUpdate.Id.ToString(),
                Name = postToUpdate.Name
            };
            var result = await _cosmosStore.UpdateAsync(cosmosPost);

            return(result.IsSuccess);
        }
예제 #2
0
        public async Task <bool> CreatePost(Post post)
        {
            var cosmosPost = new CosmosPostDTO
            {
                Id   = Guid.NewGuid().ToString(),
                Name = post.Name
            };
            var result = await _cosmosStore.AddAsync(cosmosPost);

            return(result.IsSuccess);
        }
        public async Task <bool> CreatePostAsync(Post post)
        {
            var cosmosPost = new CosmosPostDTO
            {
                Id   = post.Id.ToString(),//Guid.NewGuid().ToString()
                Name = post.Name
            };
            var response = await _cosmosStore.AddAsync(cosmosPost);

            //  post.Id = Guid.Parse(cosmosPost.Id);
            return(response.IsSuccess);
        }