-
Notifications
You must be signed in to change notification settings - Fork 3
Migration from v9 to v10
Pawel Gerr edited this page Nov 21, 2025
·
2 revisions
This guide covers breaking changes and new features when migrating from v9 to v10.
v10 introduces a new, more structured configuration API for Entity Framework Core integration. The old callback-based approach is deprecated but still supported for backward compatibility.
The UseThinktectureValueConverters method now accepts a Configuration object that provides:
- Type-safe configuration for Smart Enums and Keyed Value Objects
- Built-in max length strategies for automatic database column sizing
- Better defaults with smart enum max length calculation out-of-the-box
.UseThinktectureValueConverters(configureEnumsAndKeyedValueObjects: property =>
{
if (property.ClrType == typeof(ProductType))
{
var maxLength = ProductType.Items.Max(i => i.Key.Length);
property.SetMaxLength(maxLength + (10 - maxLength % 10)); // round up to next 10
}
else if (property.ClrType == typeof(ProductName))
{
property.SetMaxLength(200);
}
})Option 1: Use default configuration (automatic max length for string-based smart enums)
.UseThinktectureValueConverters()
// or explicitly:
.UseThinktectureValueConverters(Configuration.Default)Option 2: Custom configuration with strategies
.UseThinktectureValueConverters(new Configuration
{
SmartEnums = new SmartEnumConfiguration
{
// Automatically calculates max length from items and rounds to next 10
MaxLengthStrategy = DefaultSmartEnumMaxLengthStrategy.Instance
},
KeyedValueObjects = new KeyedValueObjectConfiguration
{
MaxLengthStrategy = new CustomKeyedValueObjectMaxLengthStrategy((type, keyType) =>
{
if (type == typeof(ProductName))
return 200;
return MaxLengthChange.None; // Max length stays unchanged
})
}
})