Exemple #1
0
        public static DbTypeAttribute FromMember(MemberInfo member)
        {
            DbTypeAttribute dbTypeAttribute = member.GetCustomAttribute <DbTypeAttribute>(true) ?? new DbTypeAttribute();

            if (dbTypeAttribute.Type == null)
            {
                dbTypeAttribute.Type = member.GetMemberInfoType();
            }

            return(dbTypeAttribute);
        }
Exemple #2
0
        public static ColumnMigratorInfo FromMemberInfo(MemberInfo member)
        {
            ColumnInfo columnInfo = ColumnInfo.FromMemberInfo(member);

            if (columnInfo.IgnoreColumn || columnInfo.ResultColumn)
            {
                return(null);
            }

            var type       = DbTypeAttribute.FromMember(member);
            var isNullable = NullableAttribute.FromMember(member);

            return(new ColumnMigratorInfo(columnInfo.ColumnName, type.Type)
            {
                DbTypeParameter = type.TypeParameter,
                AllowNull = isNullable
            });
        }