private static void FillSqlClauseBuilder <T>( SqlClauseBuilderIUW builder, T graph, ORMappingItemCollection mapping, ClauseBindingFlags bindingFlags, DoSqlClauseBuilder <T> builderDelegate, params string[] ignorProperties) { ExceptionHelper.FalseThrow <ArgumentNullException>(graph != null, "graph"); foreach (ORMappingItem item in mapping) { if (Array.Exists <string>(ignorProperties, delegate(string target) { return(string.Compare(target, item.PropertyName, true) == 0); }) == false) { if ((item.BindingFlags & bindingFlags) != ClauseBindingFlags.None) { builderDelegate(builder, item, graph); } } } }
/// <summary> /// 从XmlReader中设置属性 /// </summary> /// <param name="reader">Xml阅读器</param> /// <param name="dType">DeclaringType</param> /// <param name="mi">成员属性</param> public void ReadFromXml(XmlReader reader, System.Type dType, MemberInfo mi) { this.memberInfo = mi; this.declaringType = dType; this.propertyName = XmlHelper.GetAttributeValue(reader, "propertyName", this.propertyName); this.dataFieldName = XmlHelper.GetAttributeValue(reader, "dataFieldName", this.dataFieldName); this.format = XmlHelper.GetAttributeValue(reader, "format", this.format); this.isIdentity = XmlHelper.GetAttributeValue(reader, "isIdentity", this.isIdentity); this.primaryKey = XmlHelper.GetAttributeValue(reader, "primaryKey", this.primaryKey); this.length = XmlHelper.GetAttributeValue(reader, "length", this.length); this.isNullable = XmlHelper.GetAttributeValue(reader, "isNullable", this.isNullable); this.bindingFlags = XmlHelper.GetAttributeValue(reader, "bindingFlags", this.bindingFlags); this.defaultExpression = XmlHelper.GetAttributeValue(reader, "defaultExpression", this.defaultExpression); this.enumUsage = XmlHelper.GetAttributeValue(reader, "enumUsage", this.enumUsage); this.subClassPropertyName = XmlHelper.GetAttributeValue(reader, "subClassPropertyName", this.subClassPropertyName); this.subClassTypeDescription = XmlHelper.GetAttributeValue(reader, "subClassTypeDescription", this.subClassTypeDescription); this.encryptProperty = XmlHelper.GetAttributeValue(reader, "encryptProperty", false); this.encryptorName = XmlHelper.GetAttributeValue(reader, "encryptorName", (string)null); }
private static void FillSqlClauseBuilder <T>( SqlClauseBuilderIUW builder, T graph, ORMappingItemCollection mapping, ClauseBindingFlags bindingFlags, DoSqlClauseBuilder <T> builderDelegate, params string[] ignoreProperties) { ExceptionHelper.FalseThrow <ArgumentNullException>(graph != null, "graph"); using (ORMappingContext context = ORMappingContext.GetContext()) { foreach (ORMappingItem item in mapping) { if (Array.Exists <string>(ignoreProperties, target => (string.Compare(target, item.PropertyName, true) == 0) ) == false) { if ((item.BindingFlags & bindingFlags) != ClauseBindingFlags.None) { builderDelegate(builder, item, graph); } } } } builder.AppendTenantCode(typeof(T)); }
private static void FillSqlClauseBuilder(SelectSqlClauseBuilder builder, DataModel mapping, ClauseBindingFlags bindingFlags, DoSelectClauseBuilder builderDelegate, params string[] ignorProperties) { mapping.Properties.ForEach(property => { if (!ignorProperties.Contains(property.Name)) { if (property.OutputMapping) { builderDelegate(builder, property); } } }); }
private static void FillSqlClauseBuilder <T>(SqlClauseBuilderIUW builder, T graph, DataModel mapping, ClauseBindingFlags bindingFlags, DoSqlClauseBuilder <T> builderDelegate, string[] ignorProperties) { ExceptionHelper.FalseThrow <ArgumentNullException>(graph != null, "graph"); mapping.Properties.ForEach(property => { if (!ignorProperties.Contains(property.Name)) { if (property.InputMapping) { builderDelegate(builder, property, graph); } } }); }
private static void FillSqlClauseBuilder(SelectSqlClauseBuilder builder, ORMappingItemCollection mapping, ClauseBindingFlags bindingFlags, DoSelectClauseBuilder builderDelegate, params string[] ignorProperties) { foreach (ORMappingItem item in mapping) { if (Array.Exists <string>(ignorProperties, delegate(string target) { return(string.Compare(target, item.PropertyName, true) == 0); }) == false) { if ((item.BindingFlags & bindingFlags) != ClauseBindingFlags.None) { builderDelegate(builder, item); } } } }
/// <summary> /// 从XmlReader中设置属性 /// </summary> /// <param name="reader">Xml阅读器</param> /// <param name="mi">成员属性</param> public void ReadFromXml(XmlReader reader, MemberInfo mi) { this.memberInfo = mi; this.propertyName = XmlHelper.GetAttributeValue(reader, "propertyName", this.propertyName); this.dataFieldName = XmlHelper.GetAttributeValue(reader, "dataFieldName", this.dataFieldName); this.isIdentity = XmlHelper.GetAttributeValue(reader, "isIdentity", this.isIdentity); this.primaryKey = XmlHelper.GetAttributeValue(reader, "primaryKey", this.primaryKey); this.length = XmlHelper.GetAttributeValue(reader, "length", this.length); this.isNullable = XmlHelper.GetAttributeValue(reader, "isNullable", this.isNullable); this.bindingFlags = XmlHelper.GetAttributeValue(reader, "bindingFlags", this.bindingFlags); this.defaultExpression = XmlHelper.GetAttributeValue(reader, "defaultExpression", this.defaultExpression); this.enumUsage = XmlHelper.GetAttributeValue(reader, "enumUsage", this.enumUsage); this.subClassPropertyName = XmlHelper.GetAttributeValue(reader, "subClassPropertyName", this.subClassPropertyName); this.subClassTypeDescription = XmlHelper.GetAttributeValue(reader, "subClassTypeDescription", this.subClassTypeDescription); }
/// <summary> /// 构造方法 /// </summary> /// <param name="flags">对应的属性值会出现在哪些Sql语句中</param> /// <param name="defaultExpression">如果对应的属性值为空,使用的缺省值表达式</param> public SqlBehaviorAttribute(ClauseBindingFlags flags, string defaultExpression) : this(flags) { this.defaultExpression = defaultExpression; }
/// <summary> /// 构造方法 /// </summary> /// <param name="flags">对应的属性值会出现在哪些Sql语句中</param> public SqlBehaviorAttribute(ClauseBindingFlags flags) { this.bindingFlags = flags; }
/// <summary> /// 构造方法 /// </summary> /// <param name="subPropertyName"></param> /// <param name="flags">对应的属性值会出现在哪些Sql语句中</param> /// <param name="defaultExpression">如果对应的属性值为空,使用的缺省值表达式</param> public SubClassSqlBehaviorAttribute(string subPropertyName, ClauseBindingFlags flags, string defaultExpression) : base(flags, defaultExpression) { this.subPropertyName = subPropertyName; }
/// <summary> /// 构造方法 /// </summary> /// <param name="subPropertyName"></param> /// <param name="flags">对应的属性值会出现在哪些Sql语句中</param> public SubClassSqlBehaviorAttribute(string subPropertyName, ClauseBindingFlags flags) : base(flags) { this.subPropertyName = subPropertyName; }