/// <summary> /// 获取SQL成员信息 /// </summary> /// <param name="member">成员信息</param> /// <returns>SQL成员信息</returns> internal static sqlMember Get(memberInfo member) { sqlMember value = member.Member.customAttribute <sqlMember>(true); if (value == null || value.SqlType == null) { if (member.MemberType.Type.IsEnum) { if (value == null) { value = new sqlMember(); } value.SqlType = System.Enum.GetUnderlyingType(member.MemberType.Type); } else { sqlMember sqlMember = member.MemberType.Type.customAttribute <sqlMember>(false, false); if (sqlMember != null && sqlMember.SqlType != null) { if (value == null) { value = new sqlMember(); } value.SqlType = sqlMember.SqlType; } } } return(value ?? defaultSqlMember); }
/// <summary> /// 成员信息 /// </summary> /// <param name="member">成员信息</param> /// <param name="filter">选择类型</param> protected memberInfo(MemberInfo member, memberFilter filter) { Member = member; MemberName = member.Name; Filter = filter; IsIgnore = member.customAttributes <ignore>(true).Any(value => value.IsIgnore); if (CanGet && CanSet) { sqlMember sqlMember = member.customAttribute <sqlMember>(true); if (sqlMember != null && sqlMember.SqlType != null) { MemberType = new memberType(MemberType, sqlMember.SqlType); } } }
/// <summary> /// 成员信息 /// </summary> /// <param name="member">字段</param> /// <param name="filter">选择类型</param> private memberInfo(FieldInfo member, memberFilter filter) : this((MemberInfo)member, filter) { IsField = CanGet = true; CanSet = !member.IsInitOnly; sqlMember sqlMember = member.customAttribute <sqlMember>(true); if (sqlMember == null || sqlMember.SqlType == null) { MemberType = member.FieldType; } else { MemberType = new memberType(member.FieldType, sqlMember.SqlType); } }
/// <summary> /// 获取SQL成员信息 /// </summary> /// <param name="member">成员信息</param> /// <returns>SQL成员信息</returns> internal static sqlMember Get(memberInfo member) { sqlMember value = member.Member.customAttribute<sqlMember>(true); if (value == null || value.SqlType == null) { if (member.MemberType.Type.IsEnum) { if (value == null) value = new sqlMember(); value.SqlType = System.Enum.GetUnderlyingType(member.MemberType.Type); } else { sqlMember sqlMember = member.MemberType.Type.customAttribute<sqlMember>(false, false); if (sqlMember != null && sqlMember.SqlType != null) { if (value == null) value = new sqlMember(); value.SqlType = sqlMember.SqlType; } } } return value ?? defaultSqlMember; }