@@ -46,7 +46,7 @@ public async Task Delete(string id)
4646
4747 public async Task Put ( T entity )
4848 {
49- string id = _idSelector ( entity ) ;
49+ var id = _idSelector ( entity ) ;
5050 if ( string . IsNullOrWhiteSpace ( id ) )
5151 {
5252 throw new NotSupportedException ( "An id must be specified to put." ) ;
@@ -56,19 +56,17 @@ public async Task Put(T entity)
5656 }
5757
5858 public IEnumerable < T > Query ( Expression < Func < T , bool > > predicate = null )
59- {
60- return _documentClient
59+ => _documentClient
6160 . CreateDocumentQuery < EntityDocument < T > > ( GetUri ( ) )
6261 . Where ( x => x . Type == _entityType )
6362 . Select ( x => x . Entity )
6463 . Where ( predicate ?? ( x => true ) ) ;
65- }
6664
6765 public async Task < T > Read ( string id )
6866 {
6967 try
7068 {
71- ResourceResponse < Document > response = await _documentClient . ReadDocumentAsync ( GetUri ( id ) ) ;
69+ var response = await _documentClient . ReadDocumentAsync ( GetUri ( id ) ) ;
7270 EntityDocument < T > responseDocument = ( dynamic ) response . Resource ;
7371 return responseDocument . Entity ;
7472 }
@@ -78,17 +76,11 @@ public async Task<T> Read(string id)
7876 }
7977 }
8078
81- private Uri GetUri ( )
82- {
83- return UriFactory . CreateDocumentCollectionUri ( _database . Id , _documentCollection . Id ) ;
84- }
79+ private Uri GetUri ( ) => UriFactory . CreateDocumentCollectionUri ( _database . Id , _documentCollection . Id ) ;
8580
86- private Uri GetUri ( string id )
87- {
88- return UriFactory . CreateDocumentUri (
89- _database . Id ,
90- _documentCollection . Id ,
91- EntityDocument < T > . CreateId ( id , _entityType ) ) ;
92- }
81+ private Uri GetUri ( string id ) => UriFactory . CreateDocumentUri (
82+ _database . Id ,
83+ _documentCollection . Id ,
84+ EntityDocument < T > . CreateId ( id , _entityType ) ) ;
9385 }
94- }
86+ }
0 commit comments