public override TargetType Execute() { Query <SourceType> query = Query <TargetType> .Copy(this, new Query <SourceType>(this.Client)); SourceType result = query.Execute(); return(map(result)); }
public override async Task <TargetType> ExecuteAsync(CancellationToken?token = null) { Query <SourceType> query = Query <TargetType> .Copy(this, new Query <SourceType>(this.Client)); SourceType result = await query.ExecuteAsync(token); return(map(result)); }
public override async Task <TargetType> ExecuteAsync(CancellationToken token = default(CancellationToken)) { Query <SourceType> query = Query <TargetType> .Copy(this, new Query <SourceType>(this.Client)); SourceType result = await query.ExecuteAsync(token).ConfigureAwait(false); var targetResult = map(result); return(Constraint.NotNull(() => targetResult)); }
public MappedQuery(Query <SourceType> query, Func <SourceType, TargetType> map) : base(query.Client) { Query <SourceType> .Copy(query, this); this.map = map; }