http://blog.csdn.net/riverlau/article/details/7476449
1. 使用rownumber給view加上一個標示列
SELECT ROW_NUMBER() OVER (ORDER BY appid) AS id, * FROM (SELECT appid, 'NewsLetterService:' + CONVERT(nvarchar(8), id) AS moduleID, ServiceName AS moduleName FROM NewsLetterService UNION SELECT appid, 'Modules:' + CONVERT(nvarchar(8), ID) AS moduleID, ModuleName FROM Modules) a
2. 在模型中把該列的Enitty Key屬性設定為True