コード例 #1
0
ファイル: Mediary.cs プロジェクト: shaynevanasperen/Magneto
        /// <inheritdoc cref="ISyncQueryMediary.Query{TContext,TResult}"/>
        public virtual TResult Query <TContext, TResult>(ISyncQuery <TContext, TResult> query, TContext context)
        {
            if (query == null)
            {
                throw new ArgumentNullException(nameof(query));
            }
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            return(Decorator.Decorate(GetOperationName(query, nameof(query.Execute)), () => query.Execute(context)));
        }
コード例 #2
0
 /// <summary>
 /// Create new instance of <see cref="SyncRequestBase{T}"/>
 /// </summary>
 /// <param name="exchangeService">Exchange service.</param>
 /// <param name="syncQuery">Sync query.</param>
 internal SyncRequestBase(ExchangeService exchangeService, ISyncQuery syncQuery, Action <HttpRestUrl> httpRestUrlPreProcess)
     : base(exchangeService, httpRestUrlPreProcess)
 {
     ArgumentValidator.ThrowIfNull(syncQuery, nameof(syncQuery));
     this.syncQuery = syncQuery;
 }
コード例 #3
0
 public virtual TResult Query <TContext, TResult>(ISyncQuery <TContext, TResult> query)
 {
     return(Invoker.Query(query, GetContext <TContext>()));
 }
コード例 #4
0
 /// <summary>
 /// Create new instance of <see cref="SyncRequestBase{T}"/>
 /// </summary>
 /// <param name="exchangeService">Exchange service.</param>
 /// <param name="syncQuery">Sync query.</param>
 internal SyncRequestBase(ExchangeService exchangeService, ISyncQuery syncQuery)
     : base(exchangeService)
 {
     ArgumentValidator.ThrowIfNull(syncQuery, nameof(syncQuery));
     this.syncQuery = syncQuery;
 }
コード例 #5
0
 /// <inheritdoc cref="ISyncQueryMagneto.Query{TContext,TResult}"/>
 public virtual TResult Query <TContext, TResult>(ISyncQuery <TContext, TResult> query) =>
 Mediary.Query(query, GetContext <TContext>());