Ejemplo n.º 1
0
        /// <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()));
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 public ForeignKeyInfo(DubonProperty propertyInfo, ForeignKeyRelation relation)
 {
     DubonProperty = propertyInfo;
     Relation      = relation;
 }
Ejemplo n.º 4
0
 public KeyPropertyInfo(DubonProperty propertyInfo, bool isIdentity)
 {
     DubonProperty = propertyInfo;
     IsIdentity    = isIdentity;
 }
Ejemplo n.º 5
0
    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());
    }