Skip to content

Settings.ConfigurationClassName

Simon Hughes edited this page Aug 30, 2026 · 1 revision

Settings.ConfigurationClassName

The suffix appended to each entity name to make its Fluent API configuration class.

Type string
Default "Configuration"
Applies to EF 6 and EF Core
Databases All
In Database.tt? Yes

What it does

Each entity gets a configuration class holding its table and column mapping. This names it: Product plus "Configuration" gives ProductConfiguration.

Example

"Configuration" (default)

public interface IMyDbContext : IDisposable
public class MyDbContext : DbContext, IMyDbContext
public class MyDbContextFactory : IDesignTimeDbContextFactory<MyDbContext>
public class Category
public class Product
public class sales_Order
public class CategoryConfiguration : IEntityTypeConfiguration<Category>
public class ProductConfiguration : IEntityTypeConfiguration<Product>
public class sales_OrderConfiguration : IEntityTypeConfiguration<sales_Order>

"Map"

Settings.ConfigurationClassName = "Map";
public interface IMyDbContext : IDisposable
public class MyDbContext : DbContext, IMyDbContext
public class MyDbContextFactory : IDesignTimeDbContextFactory<MyDbContext>
public class Category
public class Product
public class sales_Order
public class CategoryMap : IEntityTypeConfiguration<Category>
public class ProductMap : IEntityTypeConfiguration<Product>
public class sales_OrderMap : IEntityTypeConfiguration<sales_Order>

When to change it

Match an existing convention. Map and Mapping are both common in codebases that started with EF 6's EntityTypeConfiguration<T>, and matching means hand-written and generated configurations sit together consistently.

Avoid a clash. If ProductConfiguration already means something in your domain - a configuration entity, say - the generated class collides with it.

Leave it alone otherwise. Configuration matches EF Core's IEntityTypeConfiguration<T> naming and is what most EF documentation uses.

Gotchas

Setting it to an empty string generates a class with the same name as the entity, which does not compile.

Renaming touches every configuration class, and any code that registers them individually rather than through ApplyConfigurationsFromAssembly.

It has nothing to do with Settings.PocoConfigurationFolder, which is where the files go, or Settings.PocoConfigurationNamespace, which is the using for them.

Generating the configuration classes at all is Settings.ElementsToGenerate and Elements.PocoConfiguration. If you have dropped that flag, this setting has nothing to name.

See also

Clone this wiki locally