// TDeserialize can be : EdgesInheritedCommandResult<List<TResult>>, InheritedCommandResult<List<TResult>> // method should be used when TResult can be change tracked public async Task <ICommandResult <List <TResult> > > RequestGenericListResult <TResult, TDeserialize>(object data = null) where TDeserialize : new() { var response = await SendCommandAsync(data).ConfigureAwait(false); ICommandResult <List <TResult> > result = null; using (var stream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) { var serializer = new DocumentSerializer(db); if (EnableChangeTracking) { result = new TDeserialize() as ICommandResult <List <TResult> >; BaseResult baseResult = null; result.Result = serializer.DeserializeBatchResult <TResult>(stream, out baseResult); result.BaseResult = baseResult; } else { result = serializer.Deserialize <TDeserialize>(stream) as ICommandResult <List <TResult> >; if (!response.IsSuccessStatusCode) { result.Result = new List <TResult>(); } } } new BaseResultAnalyzer(db).ThrowIfNeeded(result.BaseResult); return(result); }