Exemple #1
0
        public override TargetType Execute()
        {
            Query <SourceType> query = Query <TargetType> .Copy(this, new Query <SourceType>(this.Client));

            SourceType result = query.Execute();

            return(map(result));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        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));
        }
Exemple #4
0
        public MappedQuery(Query <SourceType> query, Func <SourceType, TargetType> map) : base(query.Client)
        {
            Query <SourceType> .Copy(query, this);

            this.map = map;
        }