/// <summary> /// 속성에 대해 Convention을 적용합니다. /// </summary> public void Apply(IPropertyInstance instance) { if (PropertyWithClassNames.Contains(instance.Property.Name)) { instance.Column(GetAbbrName(instance.EntityType.Name) + GetAbbrName(instance.Name)); } else { instance.Column(GetAbbrName(instance.Name)); } }
/// <summary> /// Apply changes to the target /// </summary> public void Apply(IPropertyInstance instance) { if (PropertyWithClassNames.Contains(instance.Property.Name)) { instance.Column(GetAbbrName(instance.EntityType.Name).ToOracleNaming() + Delimiter + GetAbbrName(instance.Name).ToOracleNaming()); } else { instance.Column(GetAbbrName(instance.Name).ToOracleNaming()); } }
public virtual void Apply(IPropertyInstance instance) { var customAttribute = instance.Property.MemberInfo.GetCustomAttribute(typeof(ColumnAttribute)) as ColumnAttribute; instance.Column(customAttribute != null ? customAttribute.Name : instance.Property.Name); var notInsertAttribute = instance.Property.MemberInfo.GetCustomAttribute(typeof(NotInsertAttribute)) as NotInsertAttribute; if (notInsertAttribute != null) { instance.Not.Insert(); } var notUpdateAttribute = instance.Property.MemberInfo.GetCustomAttribute(typeof(NotUpdateAttribute)) as NotUpdateAttribute; if (notUpdateAttribute != null) { instance.Not.Update(); } var nvarcharMaxAttribute = instance.Property.MemberInfo.GetCustomAttribute(typeof(NvarcharMaxAttribute)) as NvarcharMaxAttribute; if (nvarcharMaxAttribute != null) { instance.Length(4001); instance.CustomSqlType("nvarchar(max)"); } var varbinaryMaxAttribute = instance.Property.MemberInfo.GetCustomAttribute(typeof(VarbinaryMaxAttribute)) as VarbinaryMaxAttribute; if (varbinaryMaxAttribute != null) { instance.Length(2147483647); instance.CustomSqlType("varbinary(max)"); } }
public void Apply(IPropertyInstance instance) { if (instance.Property.Name.Equals("Key", StringComparison.OrdinalIgnoreCase)) { instance.Column(String.Format("[{0}]", instance.Property.Name)); } }
public void Apply(IPropertyInstance instance) { if (instance.Property.IsNotNull()) { instance.Column(instance.Property.Name.ToCamelCase()); } }
/// <summary> /// Applies the column name based on type. /// </summary> /// <param name="instance">The instance.</param> public void Apply(IPropertyInstance instance) { var columnName = instance.GetColumnAttribute(); if (!instance.Property.DeclaringType.IsNHibernateComponent()) { if (instance.Property.PropertyType.IsEnum || instance.Property.PropertyType.IsNullableEnum()) { columnName = GetColumnNameForEnum(instance.Property.Name).ToPascalCase(); // instance.Column ( columnName ); } if (columnName.IsNullOrEmpty()) { columnName = instance.Name; } var fieldName = instance.Property.MemberInfo.GetAttribute <FieldAttribute>(); if (fieldName != null) { columnName = fieldName.Name; } else { columnName = columnName.ToPascalCaseWithUndescore(); //NamingHelper.ToUppercase(columnName); } columnName = columnName.ToLower(); instance.Column(columnName); } }
public void Apply(IPropertyInstance instance) { if (instance.Property.IsNotNull()) { instance.Column(instance.Property.Name.ToCamelCase()); } }
public void Apply(IPropertyInstance instance) { var abbreviation = AttributeHelper.GetTypeAttribute<AbbreviationAttribute>(instance.EntityType); var columnName = abbreviation == null ? instance.Name : abbreviation.Abbreviation + instance.Name; instance.Column(columnName.EscapeColumnName()); }
/// <summary> /// Applies this column name convention to the specified <see cref = "IPropertyInstance" />. /// </summary> /// <param name="instance">An <see cref = "IPropertyInstance" />.</param> public void Apply(IPropertyInstance instance) { if (instance == null) { throw new ArgumentNullException("instance"); } instance.Column(instance.Property.Name); }
public void Apply(IPropertyInstance instance) { var abbreviation = AttributeHelper.GetTypeAttribute <AbbreviationAttribute>(instance.EntityType); var columnName = abbreviation == null ? instance.Name : abbreviation.Abbreviation + instance.Name; instance.Column(columnName.EscapeColumnName()); }
/// <summary> /// Applies the column name based on type. /// </summary> /// <param name="instance">The instance.</param> public void Apply( IPropertyInstance instance ) { if ( !instance.Property.DeclaringType.IsNHibernateComponent () ) { if ( instance.Property.PropertyType.IsEnum || instance.Property.PropertyType.IsNullableEnum () ) { var columnName = GetColumnNameForEnum ( instance.Property.Name ); instance.Column ( columnName ); } } }
/// <summary> /// Applies the column name based on type. /// </summary> /// <param name="instance">The instance.</param> public void Apply(IPropertyInstance instance) { if (!instance.Property.DeclaringType.IsNHibernateComponent()) { if (instance.Property.PropertyType.IsEnum || instance.Property.PropertyType.IsNullableEnum()) { var columnName = GetColumnNameForEnum(instance.Property.Name); instance.Column(columnName); } } }
/// <summary> /// The apply. /// </summary> /// <param name="instance"> /// The instance. /// </param> public void Apply(IPropertyInstance instance) { const string NamePattern = "Name"; bool isEntityTypeName = !Exceptions.Contains(instance.Property.Name) && instance.Property.Name.EndsWith(NamePattern) && instance.Property.Name == instance.EntityType.Name + NamePattern; string column = string.Format( CultureInfo.InvariantCulture, FluentConfiguration.ColumnNameTemplate, Inflector.Uncapitalize(isEntityTypeName ? instance.EntityType.Name : instance.Property.Name)); instance.Column(column); }
public void Apply(IPropertyInstance instance) { if (instance == null) { return; } // Bracket every property to ensure resevered work problems go away. instance.Column($"[{instance.Name}]"); ProcessUniqueKeyAttribute(instance); ProcessRequiredAttribute(instance); if (ProcessStringTypes(instance) || ProcessBooleanTypes(instance) || ProcessDateTypes(instance) || ProcessEnumTypes(instance)) { return; } }
public void Apply(IPropertyInstance instance) { string columnName = ConventionUtils.CamelCaseToUnderscore(instance.Property.Name); if (instance.Type == typeof(string)) { columnName = "N_" + columnName; } if (instance.Type == typeof(char)) { columnName = "N_BL_" + columnName; } if (instance.Type == typeof(DateTime)) { columnName = "FEC_" + columnName; } instance.Column(columnName); //instance. }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name); StringConvention(instance); }
public void Apply(IPropertyInstance instance) { instance.Column(NameConventions.ReplaceCamelCaseWithUnderscore(instance.Name)); }
public void Apply(IPropertyInstance instance) { instance.Column("prop-col"); }
public void Apply(IPropertyInstance instance) { string columnName = GetColumnName(instance.Property.Name); instance.Column(columnName); }
public void Apply(IPropertyInstance instance) { instance.Column(string.Format("[{0}]", instance.Name)); }
public void Apply(IPropertyInstance instance) { var name = NameConventions.ReplaceCamelCaseWithUnderscore(instance.Name); instance.Column(name.ToUpper()); }
public void Apply(IPropertyInstance instance) { instance.Column(Inflector.Inflector.Pluralize(instance.Name)); }
public void Apply(IPropertyInstance instance) { instance.Column(EscapeColumn(instance.Name)); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name.ToDatabaseName()); }
public void Apply(IPropertyInstance instance) { instance.Column(string.Format("`{0}`", Inflector.Underscore(instance.Name))); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name.Underscore()); }
public void Apply(IPropertyInstance instance) { instance.Column($"{Quote}{instance.Property.Name}{Quote}"); }
public void Apply(IPropertyInstance instance) { var columnName = Regex.Replace(instance.Name, PascalCaseRegex, "_$1").Remove(0, 1).ToLower(); instance.Column(columnName); }
public void Apply(IPropertyInstance instance) { instance.Column(StringHelper.ToLowerUnderscored(instance.Property.Name)); }
public override void Apply(IPropertyInstance instance) { base.Apply(instance); instance.Column("arbitraryName"); }
public void Apply(IPropertyInstance instance) { instance.Column("`" + instance.Property.Name + "`"); }
public void Apply(IPropertyInstance instance) { instance.Column(StringHelper.ToLowerUnderscored(instance.Property.Name)); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name.PascalCaseToAllUpperCase()); }
public void Apply(IPropertyInstance instance) { instance.Column(Inflector.Underscore(instance.Property.Name)); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Property.Name.ToUpper()); }
public void Apply(IPropertyInstance instance) { instance.Column(ConvertToCustomName(instance.Property.Name)); }
public void Apply(IPropertyInstance instance) { instance.Column("_" + instance.Name); }
public void Apply(IPropertyInstance instance) { var name = NameConventions.ReplaceCamelCaseWithUnderscore(instance.Name); instance.Column(name.ToUpper()); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Property.Name.ToUpper()); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name + "_x"); }
public void Apply(IPropertyInstance instance) { var propName = Inflector.Underscore(instance.Name.ToLower()); instance.Column(propName); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name + "XX"); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name.ToDatabaseName()); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Name); StringConvention(instance); }
public void Apply(IPropertyInstance instance) { instance.Column(EscapeColumn(instance.Name)); }
public override void Apply(IPropertyInstance instance) { base.Apply(instance); instance.Column("someOtherName"); }
public void Apply(IPropertyInstance instance) { string columnName = GetColumnName(instance.Property.Name); instance.Column(columnName); }
public void Apply(IPropertyInstance instance) { instance.Column(instance.Property.Name.ChangeCamelCaseToUnderscore()); }
public void Apply(IPropertyInstance instance) { if (instance.Name.Equals("Key", StringComparison.OrdinalIgnoreCase)) instance.Column(String.Format("[{0}]", instance.Name)); }