• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ICriterion类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ICriterion的典型用法代码示例。如果您正苦于以下问题:C# ICriterion类的具体用法?C# ICriterion怎么用?C# ICriterion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ICriterion类属于命名空间,在下文中一共展示了ICriterion类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PresortBestSplitter

 public PresortBestSplitter(ICriterion criterion,
                            uint max_features,
                            uint min_samples_leaf,
                            Random random_state)
     : base(criterion, max_features, min_samples_leaf, random_state)
 {
 }
开发者ID:geoparsYoti,项目名称:Sharpkit.Learn,代码行数:7,代码来源:PresortBestSplitter.cs


示例2: GetColumnNamesUsingPropertyName

		private static SqlString[] GetColumnNamesUsingPropertyName(
			ICriteriaQuery criteriaQuery, 
			ICriteria criteria, 
			string propertyName, 
			object value, 
			ICriterion critertion)
		{
			string[] columnNames = criteriaQuery.GetColumnsUsingProjection(criteria, propertyName);
			IType propertyType = criteriaQuery.GetTypeUsingProjection(criteria, propertyName);

			if (value != null && !(value is System.Type) && !propertyType.ReturnedClass.IsInstanceOfType(value))
			{
				throw new QueryException(string.Format(
											"Type mismatch in {0}: {1} expected type {2}, actual type {3}",
											critertion.GetType(), propertyName, propertyType.ReturnedClass, value.GetType()));
			}

			if (propertyType.IsCollectionType)
			{
				throw new QueryException(string.Format(
											"cannot use collection property ({0}.{1}) directly in a criterion,"
											+ " use ICriteria.CreateCriteria instead",
											criteriaQuery.GetEntityName(criteria), propertyName));
			}
			return Array.ConvertAll<string, SqlString>(columnNames, delegate(string col)
			{
				return new SqlString(col);
			});
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:29,代码来源:CriterionUtil.cs


示例3: CriteriaQuery

 public CriteriaQuery(ICriterion  criteria)
 {
     if (criteria != null)
     {
         this.criterion = criteria;
         this.criterion.SetQuery(this);
     }
 }
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:8,代码来源:CriteriaQuery.cs


示例4: FindChildren

 private IEnumerable<FileSystemItem> FindChildren(FileSystemPath path, ICriterion criterion)
 {
     return Session.CreateCriteria<FileSystemItem>()
         .Add(Restrictions.Eq("Path.Parent", path.ToString()))
         .Add(criterion)
         .AddOrder(Order.Asc("Path.Name"))
         .SetCacheable(true)
         .List<FileSystemItem>();
 }
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:9,代码来源:DatabaseFileSystem.cs


示例5: SplitterBase

 public SplitterBase(ICriterion criterion,
                 uint max_features,
                 uint min_samples_leaf,
                 Random random_state)
 {
     this.criterion = criterion;
     this.max_features = max_features;
     this.min_samples_leaf = min_samples_leaf;
     this.random_state = random_state ?? new Random();
 }
开发者ID:geoparsYoti,项目名称:Sharpkit.Learn,代码行数:10,代码来源:SplitterBase.cs


示例6: AddCriterionToCriteria

		/// <summary>
		/// Adds a collection of ICriterion to an ICriteria.
		/// </summary>
		/// <param name="criteria">The ICriteria that will be modified.</param>
		/// <param name="criterions">The collection of Criterion.</param>
		internal static void AddCriterionToCriteria(ICriteria criteria, ICriterion[] criterions)
		{
			if (criterions != null)
			{
				foreach (ICriterion cond in criterions)
				{
					criteria.Add(cond);
				}
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:15,代码来源:CriteriaHelper.cs


示例7: CountQuery_ByTypeAndCriteria

		public void CountQuery_ByTypeAndCriteria()
		{
			Prepare();
			ICriterion[] criterionArray = new ICriterion[] 
            { 
                Expression.Eq("Category", "c")
            };
			CountQuery cq = new CountQuery(typeof(Post), criterionArray);
			int recordCount = (int)ActiveRecordMediator.ExecuteQuery(cq);
			Assert.AreEqual(2, recordCount);
		}
开发者ID:sheefa,项目名称:Castle.ActiveRecord,代码行数:11,代码来源:CountQueryTestCase.cs


示例8: GetFunctionCriteria

        public static SqlFunctionExpression GetFunctionCriteria(MethodCallExpression call, ICriterion criterion,
            SqlFunctionExpression rightFunction)
        {
            System.Type[] paramTypes = null;
            object[] paramValues = GetMethodParameterValues(call, out paramTypes);

            int propertyPosition = 0;
            string methodName = QueryUtil.GetMethodName(call, out propertyPosition);

            return new SqlFunctionExpression(methodName, call.Method.ReturnType, paramValues, paramTypes, criterion,
                                             propertyPosition, rightFunction);
        }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:12,代码来源:QueryUtil.cs


示例9: SqlFunctionExpression

 public SqlFunctionExpression(String functionName, System.Type returnType, Object[] paramValues,
     System.Type[] paramTypes, ICriterion innerCriterion, int propertyPosition,
     SqlFunctionExpression rightFunction)
 {
     FunctionName = functionName;
     ReturnType = returnType;
     ParameterValues = paramValues;
     ParameterTypes = paramTypes;
     InnerCriterion = innerCriterion;
     PropertyPosition = propertyPosition;
     RightFunction = rightFunction;
 }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:12,代码来源:SqlFunctionExpression.cs


示例10: Find

 public static IList Find(ICriterion crit, Type type, PagerInfo pi)
 {
     ISession s = Sessions.GetSession();
     try
     {
         ICriteria c = s.CreateCriteria(type);
         if (crit != null ) c.Add(crit);
         if (pi != null )
         {
             c.SetFirstResult(pi.FirstResult);
             c.SetMaxResults(pi.MaxResults);
         }
         return c.List();
     }
     finally
     {
         s.Close();
     }
 }
开发者ID:megadotnet,项目名称:DotNetDataAccessPerformanceProfiler,代码行数:19,代码来源:ObjectLoader.cs


示例11: KPGridJsonProperties

 public KPGridJsonProperties(bool isSearch, int page, int rows,
                             string propertyOrder, string orderTypeJason,
                             string filterJson,  KPSessionJQGrid sessionJQGrid, string propertyCompany,
                             ICriterion initialFilter, Order initialOrder, object[] colModel)
 {
     IsSearch = isSearch;
     Page = page;
     Rows = rows;
     PropertyOrder = propertyOrder;
     OrderTypeJson = orderTypeJason;
     User = sessionJQGrid.SecuritySession.Login;
     Company = sessionJQGrid.SecuritySession.FrwCompany;
     PropertyCompanyEntity = propertyCompany;
     FilterJson = filterJson;
     ColModel = Array.ConvertAll<object, string>(colModel, Convert.ToString);
     List<JqGridColumnCustom> jqGridColumnCustomList = new List<JqGridColumnCustom>();
     foreach (string item in ColModel)
         jqGridColumnCustomList.Add(KPJsonJqGrid.GetColumnCustom(item));
     ColumnsCustom = jqGridColumnCustomList.ToArray();
     InitialFilter = initialFilter;
     InitialOrder = initialOrder;
 }
开发者ID:NumericTechnology,项目名称:Platanum.Net,代码行数:22,代码来源:KPGridJsonProperties.cs


示例12: KPJqGridControl

        public KPJqGridControl(string primaryKey, HiddenField hiddenKey, Type typeEntity, KPItemModelCollection KPitemsModel,
                              KPJqGridDoubleClickActionEnum DoubleClickAction, ICriterion filter, Order order)
        {
            #region Filter/Order
            this.InitialFilter = filter;
            this.InitialOrder = order;
            #endregion

            this.HiddenKey = hiddenKey == null ? new HiddenField() : hiddenKey;
            this.Caption = String.Empty;
            this.PrimaryKey = primaryKey;
            this.UrlService = System.Web.VirtualPathUtility.ToAbsolute("~/WCF/EntityService.svc/GetEntityFilter");
            this.TypeEntity = typeEntity;
            this.KPItemsModel = KPitemsModel;
            this.DoubleClickAction = DoubleClickAction;

            this.RowNum = KPJqGridRowNumEnum.RowsView_10;
            this.OrderRecords = KPJqGridTypeOrderEnum.ASC;
            this.ViewTotalRecordsLabel = true;
            this.Height = 100;
            this.Width = 300;
        }
开发者ID:NumericTechnology,项目名称:Platanum.Net,代码行数:22,代码来源:KPJqGridControl.cs


示例13: GetColumnNamesForSimpleExpression

		public static SqlString[] GetColumnNamesForSimpleExpression(
			string propertyName,
			IProjection projection,
			ICriteriaQuery criteriaQuery,
			ICriteria criteria,
			IDictionary<string, IFilter> enabledFilters,
			ICriterion criterion,
			object value)
		{
			if (projection == null)
			{
				return GetColumnNamesUsingPropertyName(
					criteriaQuery, 
					criteria, 
					propertyName,
					value, 
					criterion);
			}
			else
			{
				return GetColumnNamesUsingProjection(projection, criteriaQuery, criteria, enabledFilters);
			}
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:23,代码来源:CriterionUtil.cs


示例14: AddCriterionEvent

 public AddCriterionEvent(ICriterion criterion)
 {
     this.criterion = criterion;
 }
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:4,代码来源:AddCriterionEvent.cs


示例15: FindAllStateless

		/// <summary>
		/// Returns all instances found for the specified type
		/// using criteria and IStatelessSession.
		/// </summary>
		/// <param name="type">The target type.</param>
		/// <param name="criterias">The criteria expression</param>
		/// <param name="sortItems">An <see cref="Array"/> of <see cref="Order"/> objects.</param>
		/// <param name="firstRow">The number of the first row to retrieve.</param>
		/// <param name="maxRows">The maximum number of results retrieved.</param>
		/// <returns>The <see cref="Array"/> of results.</returns>
		public virtual Array FindAllStateless(Type type, ICriterion[] criterias, Order[] sortItems, int firstRow, int maxRows)
		{
			using (IStatelessSession session = GetStatelessSession())
			{
				try
				{
					ICriteria criteria = session.CreateCriteria(type);

					if (criterias != null)
					{
						foreach (ICriterion cond in criterias)
						{
							criteria.Add(cond);
						}
					}

					if (sortItems != null)
					{
						foreach (Order order in sortItems)
						{
							criteria.AddOrder(order);
						}
					}

					if (firstRow != int.MinValue) criteria.SetFirstResult(firstRow);
					if (maxRows != int.MinValue) criteria.SetMaxResults(maxRows);
					IList result = criteria.List();

					Array array = Array.CreateInstance(type, result.Count);
					result.CopyTo(array, 0);

					return array;
				}
				catch (Exception ex)
				{
					throw new DataException("Could not perform FindAllStateless for " + type.Name, ex);
				}
			}
		}
开发者ID:janv8000,项目名称:Windsor,代码行数:49,代码来源:NHibernateGenericDao.cs


示例16: Add

 public void Add(ICriterion criteria) {
    _criteria.Add(criteria);
 }
开发者ID:ManfredLange,项目名称:csUnit,代码行数:3,代码来源:OrCriterion.cs


示例17: AndExpression

		/// <summary>
		/// Initializes a new instance of the <see cref="AndExpression"/> class
		/// that combines two <see cref="ICriterion"/>.
		/// </summary>
		/// <param name="lhs">The <see cref="ICriterion"/> to use as the left hand side.</param>
		/// <param name="rhs">The <see cref="ICriterion"/> to use as the right hand side.</param>
		public AndExpression(ICriterion lhs, ICriterion rhs) : base(lhs, rhs)
		{
		}
开发者ID:hazzik,项目名称:nh-contrib-everything,代码行数:9,代码来源:AndExpression.cs


示例18: ConditionalProjection

		public ConditionalProjection(ICriterion criterion, IProjection whenTrue, IProjection whenFalse)
		{
			this.whenTrue = whenTrue;
			this.whenFalse = whenFalse;
			this.criterion = criterion;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:6,代码来源:ConditionalProjection.cs


示例19: Where

 public static Array Where(Type t, ICriterion[] criteria, Order[] order)
 {
     return FindAll(t, order, criteria);
 }
开发者ID:monsterlabs,项目名称:HumanRightsTracker,代码行数:4,代码来源:ActiveRecordMetaBase.cs


示例20: FindFirst

 public static Object FindFirst(Type t, ICriterion[] criteria)
 {
     return FindOne(t, criteria);
 }
开发者ID:monsterlabs,项目名称:HumanRightsTracker,代码行数:4,代码来源:ActiveRecordMetaBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ICruiseRequest类代码示例发布时间:2022-05-24
下一篇:
C# ICriteriaQuery类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap