public LowercaseWithUnderscoresConventionMappingSettings() { this.ResolveColumnName = (PropertyInfo propertyInfo) => ConventionMappingSettings.GetColumnName(propertyInfo).ToUnderscored().ToLowerInvariant(); this.ResolveIdentifierColumnName = (PropertyInfo propertyInfo) => propertyInfo.Name.ToUnderscored().ToLowerInvariant(); this.ResolveTableName = (Type type) => { var tableName = UsePluralClassNameForTableName ? this.InflectionService.ToPlural(GetTableName(type)) : GetTableName(type); return(tableName.ToUnderscored().ToLowerInvariant()); }; }
/// <summary> /// Initialises a new instance of the <see cref="LowercaseWithUnderscoresConventionMappingSettings"/> class. /// </summary> public LowercaseWithUnderscoresConventionMappingSettings() { #pragma warning disable CA1308 // Normalize strings to uppercase ResolveColumnName = (PropertyInfo propertyInfo) => ConventionMappingSettings.GetColumnName(propertyInfo).ToUnderscored().ToLowerInvariant(); ResolveIdentifierColumnName = (PropertyInfo propertyInfo) => propertyInfo.Name.ToUnderscored().ToLowerInvariant(); ResolveTableName = (Type type) => { string tableName = UsePluralClassNameForTableName ? InflectionService.ToPlural(GetTableName(type)) : GetTableName(type); return(tableName.ToUnderscored().ToLowerInvariant()); #pragma warning restore CA1308 // Normalize strings to uppercase }; }
/// <summary> /// Configures the MicroLite ORM Framework to use custom convention settings for the default convention based mapping. /// </summary> /// <param name="configureExtensions">The interface to configure extensions.</param> /// <param name="settings">The settings for the convention mapping.</param> /// <returns>The interface which provides the extension points.</returns> /// <exception cref="System.ArgumentNullException">Thrown if any argument is null.</exception> public static IConfigureExtensions WithConventionBasedMapping( this IConfigureExtensions configureExtensions, ConventionMappingSettings settings) { if (configureExtensions == null) { throw new ArgumentNullException("configureExtensions"); } if (settings == null) { throw new ArgumentNullException("settings"); } configureExtensions.SetMappingConvention(new ConventionMappingConvention(settings)); return configureExtensions; }
internal ConventionMappingConvention(ConventionMappingSettings settings) { this.settings = settings; }
internal ConventionMappingConvention(ConventionMappingSettings settings) { this.settings = settings; }
internal ConventionMappingConvention(ConventionMappingSettings settings) => _settings = settings;