Exemplo n.º 1
0
        public async Task <User> GetByIdAsync(string id)
        {
            try
            {
                ItemResponse <User> response = await DbContainer.ReadItemAsync <User>(id, new PartitionKey(id));

                return(response.Resource);
            }
            catch (CosmosException ex) when(ex.StatusCode == System.Net.HttpStatusCode.NotFound)
            {
                return(null);
            }
        }