I would like to define PL/pgSQL function and set trigger for it. I know that EF
does not work with triggers. But I saw solutions like this.
Ok, it looks like nice. But It works for old EF
. What bout EF Core
? Have it suitable method?
I will show you my code:
public partial class CreateTriggrerBeforeInsertToFailedPushes : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
Sql(@"< here is my function text>");
Sql(@"< here is my trigger text>");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
Sql(@"< here is command for remove the trigger >");
Sql(@"< here is command for remove the function >");
}
}
What do you think about it? Will it work? Or it is bad idea and there is a better way?