2014-10-27 51 views
0

這是我的觀點的數據得到一個觀點正確的數據:爲什麼我不使用EF

enter image description here

這裏是我的代碼:

DBEntities entities = new DBEntities(); 
var test = entities.V_UserPower.ToList(); 

enter image description here

奇怪的是,test沒有得到我所期望的數據。列表test中的所有四個元素都是相同的,並且這些值與查看的sql結果不同。

爲什麼發生?

+1

顯示您的代碼。 – Justin 2014-10-27 04:04:25

+1

你是如何定義EF模型的關鍵的? – 2014-10-27 04:08:11

+1

可能重複的[數據庫上下文視圖對象與預期使用MVC 4](http://stackoverflow.com/questions/13419411/database-context-view-objects-not-working-as-expected-with-mvc- 4) – 2014-10-27 08:58:08

回答

0

的數據庫上下文搜索可能的重複對象未按預期隨着MVC 4 - 1天前

感謝格特格特·阿諾德!這就是問題所在。