/// <inheritdoc /> /// <summary> /// Resolves the column name for the property. /// Looks for the [Column] attribute. Otherwise it's just the name of the property. /// </summary> public virtual Tuple <string, Type> ResolveDataColumn(DubonProperty propertyInfo) { var columnAttr = propertyInfo.PropertyInfo.GetCustomAttribute <ColumnAttribute>(); return(columnAttr != null ? new Tuple <string, Type>(columnAttr.Name, columnAttr.GetType()) : new Tuple <string, Type>(propertyInfo.PropertyInfo.Name, propertyInfo.PropertyInfo.GetType())); }
/// <summary> /// Resolves the column name for the property. /// Looks for the [Column] attribute. Otherwise it's just the name of the property. /// </summary> public virtual string Resolve(DubonProperty propertyInfo) { var columnAttr = propertyInfo.PropertyInfo.GetCustomAttribute <ColumnAttribute>(); if (columnAttr != null) { return(columnAttr.Name); } return(propertyInfo.Name); }
public ForeignKeyInfo(DubonProperty propertyInfo, ForeignKeyRelation relation) { DubonProperty = propertyInfo; Relation = relation; }
public KeyPropertyInfo(DubonProperty propertyInfo, bool isIdentity) { DubonProperty = propertyInfo; IsIdentity = isIdentity; }
public string Resolve(DubonProperty info) { var re = new Regex(@"([A-Z])([A-Z][a-z])|([a-z0-9])([A-Z])"); return(re.Replace(info.Name, @"$1$3_$2$4").ToLower()); }