标签:.sh share shared 窗口 视图 inner .com 映射 png
在数据库中先把视图建好,
然后在右键视图->编写视图脚本->CREATE->新查询窗口
在光标出添加主键
1 CREATE VIEW [dbo].[V_ShareData] 2 AS 3 SELECT ISNULL(NEWID(), ‘d1e57ca7-6eee-495a-be13-73d5e7d51f36‘) AS Id,dbo.ShareData.*, dbo.Tag.TagName, dbo.[User].UserName 4 FROM dbo.Tag INNER JOIN 5 dbo.ShareData ON dbo.Tag.TagId = dbo.ShareData.TagId INNER JOIN 6 dbo.[User] ON dbo.ShareData.UserId = dbo.[User].UserId
然后在视图中就有主键,可以在EF中映射了
标签:.sh share shared 窗口 视图 inner .com 映射 png
原文地址:https://www.cnblogs.com/CoffeeEddy/p/10105167.html