当sqlserver创建的view没有唯一的标识字段里,entity framework codefirst配置会出现错误,因为取其行号作为唯一标识列
CREATE VIEW [SafeWatch].[MissionInvalidItemView]
AS
SELECT ROW_NUMBER() OVER(ORDER BY aci.Id ASC) AS RowNumber,
ac.AppCheckItemId,
FROM SafeWatch.AppCheck ac
INNER JOIN SafeWatch.AppCheckItem aci ON aci.Id = ac.AppCheckItemId
LEFT JOIN SafeWatch.MissionInvalidItem mii ON mii.AppCheckId = ac.Id
WHERE ac.CheckResult>1
GO