Generic converter bounding in EF Core

Is there an way to "easily" define converters for all properties which uses an generic type? Currently, I have something like this:

protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder)
{
    configurationBuilder.Properties<EntityId<User>>().HaveConversion<EntityIdValueConverter<User>>();
    configurationBuilder.Properties<EntityId<Tenant>>().HaveConversion<EntityIdValueConverter<Tenant>>();
}


and an ugly static method that gets all properties from entities, map eachs one and applies the converter using reflection and activator.
Was this page helpful?