win7user10 / Laraue.EfCoreTriggers

Library to write triggers in C# with EF.Core
MIT License
114 stars 22 forks source link

Error when adding migration with AfterUpdate trigger #49

Closed kjkrum closed 2 years ago

kjkrum commented 2 years ago

Laraue.EfCoreTriggers.Common 6.3.2 Laraue.EfCoreTriggers.SqlServer 6.3.2 Microsoft.EntityFrameworkCore.SqlServer 6.0.7 Microsoft.EntityFrameworkCore.Tools 6.0.7

I created a test trigger that does nothing:

builder.Entity<User>().AfterUpdate(trigger =>
{
    trigger.Action(action =>
    {
        action.ExecuteRawSql("NULL");
    });
});

Then I ran add-migration and got this error:

Cannot scaffold C# literals of type Laraue.EfCoreTriggers.Common.TriggerBuilders.OnUpdate.OnUpdateTrigger`1[MyProject.Entities.User]'. The provider should implement CoreTypeMapping.GenerateCodeLiteral to support using it at design time.

kjkrum commented 2 years ago

Nevermind, I forgot to call UseSqlServerTriggers().