public async Task <T> GetAsync(string id) { var bucket = await _provider.GetBucketAsync(); var collection = bucket.DefaultCollection(); var result = await collection.GetAsync(id); var content = result.ContentAs <T>(); return(content); }
public async Task <IEnumerable <T> > GetAllAsync() { var bucket = await _provider.GetBucketAsync(); var context = new BucketContext(bucket); var query = (from a in context.Query <T>() select a). Take(10); return(query.ToList()); }