public bool Equals(OperateTypeEnum obj) { if ((object)obj == null) { return(false); } return(StringComparer.OrdinalIgnoreCase.Equals(this.Value, obj.Value)); }
/// <summary> /// 数据库sql where参数封装类 /// </summary> /// <param name="expression">表达式,例u=>u.Id</param> /// <param name="value">表达式的值</param> /// <param name="operateType">操作逻辑</param> /// <param name="logicType">连接逻辑</param> public DbWhere(Expression <Func <TEntity, object> > expression, object value, OperateTypeEnum operateType = OperateTypeEnum.Equal, LogicTypeEnum logicType = LogicTypeEnum.And) { PropertyInfo property = GetProperty(expression) as PropertyInfo; var real = property.GetCustomAttribute(typeof(ColumnAttribute), false); if (real != null && real is ColumnAttribute) { PropertyName = ((ColumnAttribute)real).Name; } else { PropertyName = property.Name; } Value = value; OperateType = operateType; LogicType = logicType; }
public SelectAttributeType(OperateTypeEnum operateType, List<AbstractPlatformComponent> refDlls, bool isEntity) { InitializeComponent(); _operateType = operateType; _isEntity = isEntity; if (_operateType != OperateTypeEnum.Common) { if (refDlls != null && refDlls.Count > 0) { foreach (ProjectRefrence pr in refDlls) { //删除的dll不能进行选择 if (pr.DataState == DataState.Delete) continue; if (_operateType == OperateTypeEnum.Return) { _refDlls.Add(pr); } //引用实体,聚合实体,继承实体,需要加入所有的实体 else if (_operateType == OperateTypeEnum.Refrence) { if (_isEntity) { if (pr.RefrenceType == RefType.BEEntity) { _refDlls.Add(pr); } } else { if (pr.RefrenceType == RefType.Deploy) { _refDlls.Add(pr); } } } else if (_operateType == OperateTypeEnum.Composition) { if (_isEntity) { if (pr.RefrenceType == RefType.BEEntity) { _refDlls.Add(pr); } } else { if (pr.RefrenceType == RefType.Deploy) { _refDlls.Add(pr); } } } else if (_operateType == OperateTypeEnum.Inhert) { if (_isEntity) { if (pr.RefrenceType == RefType.BEEntity) { _refDlls.Add(pr); } } else { if (pr.RefrenceType == RefType.Deploy) { _refDlls.Add(pr); } } } } } } }