Ferrous API Reference

All Types / Ferrous.EntityFrameworkCore

class FerrousNewtypeConventionExtensions

public static class FerrousNewtypeConventionExtensions

Convention extensions for zero-boilerplate [Newtype] discovery in EF Core DbContext models.

Methods

public static ModelConfigurationBuilder UseFerrousNewtypes(
        this ModelConfigurationBuilder configurationBuilder,
        params Assembly[] assemblies)

Scans assemblies for structs annotated with NewtypeAttribute and registers EF Core value converters for all of them automatically. Call from DbContext.ConfigureConventions(ModelConfigurationBuilder).

public static ModelConfigurationBuilder UseFerrousNewtypes<TAssemblyMarker>(
        this ModelConfigurationBuilder configurationBuilder)

Scans the assembly containing TAssemblyMarker for [Newtype] structs and registers EF Core value converters for all of them automatically.