Closed
Description
I want to create a persisted computed column to be able to have index on it in MSSQL.
Im trying following piece of code for mapping but column isn't getting created in sql:
classMap.Property(prop.Name, pMap =>
{
pMap.Formula("CAST(CASE WHEN [Column1] > [Column2] THEN 1 ELSE 0 END AS bit) PERSISTED");
pMap.Generated(PropertyGeneration.Always);
pMap.Update(false);
pMap.Insert(false);
pMap.Index($"IX_{type.Name}_{prop.Name}");
});
Can anyone please tell me what im doing wrong?