Computed Column with Function

Hello,

we have Computed Column with Functions in our Table - it seems since NET 7 there is a different behaviour how this will used by Entity Framework - we got the following error:

Could not save changes because the target table has computed column with a function that performs data access. Please configure your entity type accordingly, see Breaking changes in EF Core 7.0 (EF7) - EF Core | Microsoft Learn for more information.

here the column from generated code:

[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
public string Pfuscherliste { get; set; }

here sqlserver table

[Pfuscherliste]  AS ([dbo].[fn_PfuscherlisteProAkt]([Akt_ID])),

robert

You can use OnModelBuilding partial method of the generated DbContext to extend the context.

I have solved it as shown here
Upgrading to .Net 7 - Funky Si's Blog (funkysi1701.com)