|
|
@ -18,13 +18,24 @@ namespace SqlSugar |
|
|
|
return new DynamicProperyBuilder(); |
|
|
|
} |
|
|
|
public DynamicBuilder baseBuilder; |
|
|
|
public DynamicProperyBuilder CreateProperty(string propertyName, Type properyType, SugarColumn table) |
|
|
|
public DynamicProperyBuilder CreateProperty(string propertyName, Type properyType, SugarColumn column=null,bool isSplitField=false) |
|
|
|
{ |
|
|
|
if (column == null) |
|
|
|
{ |
|
|
|
column = new SugarColumn() |
|
|
|
{ |
|
|
|
ColumnName=propertyName |
|
|
|
}; |
|
|
|
} |
|
|
|
PropertyMetadata addItem = new PropertyMetadata(); |
|
|
|
addItem.Name = propertyName; |
|
|
|
addItem.Type = properyType; |
|
|
|
addItem.CustomAttributes = new List<CustomAttributeBuilder>() { baseBuilder.GetProperty(table) }; |
|
|
|
addItem.CustomAttributes = new List<CustomAttributeBuilder>() { baseBuilder.GetProperty(column) }; |
|
|
|
baseBuilder.propertyAttr.Add(addItem); |
|
|
|
if (isSplitField) |
|
|
|
{ |
|
|
|
addItem.CustomAttributes.Add(baseBuilder.GetSplitFieldAttr(new SplitFieldAttribute())); |
|
|
|
} |
|
|
|
return this; |
|
|
|
} |
|
|
|
public DynamicProperyBuilder WithCache(bool isCache=true) |
|
|
|