Entity Framework,让SystemVersioning列自动成为Temporal表的NotMapped。

问题描述 投票:0回答:1

Entity Framework似乎不能很好地处理时态表的System Versioning列(StartDate,EndDate)。当我们自动构建一个数据库时,我们希望将SystemVersioning列放置为 NotMapped. 在命令行中是否有一个参数可以让系统版本化的列自动变成不映射?公司有1000多张表,需要在每次重构时让它们自动不映射。脚手架是每周都要做的。

dotnet ef dbcontext scaffold 
c# .net entity-framework asp.net-core .net-core
1个回答
2
投票

使列HIDDEN,就不会被脚手架化。

ALTER TABLE [dbo].[Account] ALTER COLUMN [StartDate] ADD HIDDEN;

在MS SQL Server中隐藏表中的列

© www.soinside.com 2019 - 2024. All rights reserved.