当前位置: 首页>>代码示例>>C#>>正文


C# IQuery.GetType方法代码示例

本文整理汇总了C#中IQuery.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.GetType方法的具体用法?C# IQuery.GetType怎么用?C# IQuery.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IQuery的用法示例。


在下文中一共展示了IQuery.GetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetQueryExecutor

        /// <summary>
        ///   Returns a multi class query executor (polymorphic = true)
        /// </summary>
        public IQueryExecutor GetQueryExecutor(IQuery query, IStorageEngine engine)
        {
            if (query is ValuesCriteriaQuery)
                return new MultiClassGenericQueryExecutor(new ValuesCriteriaQueryExecutor(query, engine));

            if (query is SodaQuery)
                return new MultiClassGenericQueryExecutor(new CriteriaQueryExecutor(query, engine));

            throw new OdbRuntimeException(NDatabaseError.QueryTypeNotImplemented.AddParameter(query.GetType().FullName));
        }
开发者ID:SchwarzerLoewe,项目名称:Paint,代码行数:13,代码来源:QueryManager.cs

示例2: Validate

#pragma warning disable 1591 // Xml Comments
        public QueryValidationResult Validate(IQuery query)
        {
            var brokenRules = new Dictionary<IRule, BrokenRule>();

            var ruleContext = _ruleContexts.GetFor(query);
            ruleContext.OnFailed(RuleFailed(ruleContext, brokenRules));

            var hasDescriptor = _descriptors.CallGenericMethod<bool, IQueryValidationDescriptors>(d => d.HasDescriptorFor<IQuery>, query.GetType());
            if (hasDescriptor)
            {
                var descriptor = _descriptors.CallGenericMethod<IQueryValidationDescriptor, IQueryValidationDescriptors>(d => d.GetDescriptorFor<IQuery>, query.GetType());
                descriptor.ArgumentRules.ForEach(r => {
                    var value = r.Property.GetValue(query);
                    r.Evaluate(ruleContext, value);
                });
            }

            var result = new QueryValidationResult(brokenRules.Values);
            return result;
        }
开发者ID:LenFon,项目名称:Bifrost,代码行数:21,代码来源:QueryValidator.cs

示例3: GetQueryPropertyFromQuery

 PropertyInfo GetQueryPropertyFromQuery(IQuery query)
 {
     var property = query.GetType().GetProperty(QueryPropertyName, BindingFlags.Public | BindingFlags.Instance);
     return property;
 }
开发者ID:jarlef,项目名称:Bifrost,代码行数:5,代码来源:QueryCoordinator.cs

示例4: For

 /// <summary>
 /// Creates a <see cref="QueryResult"/> for a given <see cref="IQuery"/>
 /// </summary>
 /// <param name="query"><see cref="IQuery"/> to create for</param>
 /// <returns><see cref="QueryResult"/> for the given <see cref="IQuery"/></returns>
 public static QueryResult For(IQuery query)
 {
     var result = new QueryResult
     {
         QueryName = query.GetType().Name
     };
     return result;
 }
开发者ID:jarlef,项目名称:Bifrost,代码行数:13,代码来源:QueryResult.cs

示例5: NoQueryPropertyException

 /// <summary>
 /// Initializes a new instance of <see cref="NoQueryPropertyException"/>
 /// </summary>
 /// <param name="query"><see cref="IQuery"/> that does not have the property on it</param>
 public NoQueryPropertyException(IQuery query)
     : base(string.Format("No query property for {0}. Hint: It should be a public instance property with a get on it.", query.GetType().FullName))
 {
 }
开发者ID:LenFon,项目名称:Bifrost,代码行数:8,代码来源:NoQueryPropertyException.cs

示例6: UnknownQueryTypeException

 /// <summary>
 /// Initializes a new instance of <see cref="UnknownQueryTypeException"/>
 /// </summary>
 /// <param name="query"><see cref="IQuery"/> that does not have the property on it</param>
 /// <param name="type"><see cref="Type"/> of the expected query returned from the Query property</param>
 public UnknownQueryTypeException(IQuery query, Type type)
     : base(string.Format("Unable to find a query provider of type '{0}' for the query '{1}'. Hint: Are you sure the query return type has a known query provider for it?", type.FullName, query.GetType().FullName))
 {
 }
开发者ID:LenFon,项目名称:Bifrost,代码行数:9,代码来源:UnknownQueryTypeException.cs

示例7: QueryAndType

 public QueryAndType(IQuery query)
 {
     Query = query;
     Type = query.GetType();
 }
开发者ID:decojs,项目名称:QvcFluentValidation,代码行数:5,代码来源:QueryAndType.cs


注:本文中的IQuery.GetType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。