There is a special, yet-to-be-documented hook to override design-time services:
class Startup
{
public static void ConfigureDesignTimeServices(IServiceCollection services)
=> services.AddSingleton<EntityTypeWriter, MyEntityTypeWriter>();
}
Then implement your custom generator.
class MyEntityTypeWriter : EntityTypeWriter
{
public EntityTypeWriter(CSharpUtilities cSharpUtilities)
: base(cSharpUtilities)
{
}
// TODO: Override with custom implementation
}
Update: See Yehuda Goldenberg's answer for another way to do this in EF Core 1.0.2+.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…