Ferrous API Reference

All Types / Ferrous.EntityFrameworkCore

class FerrousModelConfigurationExtensions

public static class FerrousModelConfigurationExtensions

Extension methods for registering Ferrous value converters in EF Core DbContext models.

Methods

public static ModelConfigurationBuilder UseFerrousConventions(this ModelConfigurationBuilder configurationBuilder)

Registers default EF Core model conventions for NonEmptyString and NonZero<T> across common numeric types (int, long, short, byte, uint, ulong, decimal, double, and float). Call from DbContext.ConfigureConventions(ModelConfigurationBuilder).

public static PropertyBuilder<TNewtype> HasNewtypeConversion<TNewtype, TUnderlying>(
        this PropertyBuilder<TNewtype> propertyBuilder,
        Func<TNewtype, TUnderlying> toProvider,
        Func<TUnderlying, TNewtype> fromProvider)

Configures a property of a [Newtype] struct to persist as its underlying column type using NewtypeValueConverter<TNewtype, TUnderlying>.