当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - Does anyone know of a .NET enum of Comparison Operators in System or System.Core?

问题描述:

Is there an enum in System or System.Core that has all the ComparisonOperators?

I just wrote the following enum, but it seems like a common enough thing that one might already exist.

public enum ComparisonPredicate

{

Equal,

Unequal,

LessThan,

LessThanOrEqualTo,

GreaterThan,

GreaterThanOrEqualTo

}

I found one in System.Web.UI, but it would be more than silly to introduce a dependency for that http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.validationcompareoperator(v=VS.100).aspx

Also, I already looked at ExpressionType, but I don't want something with that broad of a scope

网友答案:

AFIK such a thing does not exist. You are probably better off using your own, for now.

网友答案:

A bit late, but .Net 3.5 introduced the ExpressionType enumeration in System.Linq.Expressions, see http://msdn.microsoft.com/en-us/library/bb361179(v=vs.110).aspx for more details.

分享给朋友:
您可能感兴趣的文章:
随机阅读: