使用Entity框架获取包含数据库值的列表

时间:2016-01-13 12:55:48

标签: c# sql-server entity-framework

我正在使用SQL Server 2015和最新版本的Entity Framework。我为我的应用程序创建了一个Entity数据模型。我需要获取我在数据库中创建的列表。

这是我的表结构: enter image description here

当我想查询并查找属于某个列表的所有单词时会发生这种情况

select contentwords.word 
from ContentWords 
inner join content 
  on ContentWords.ContentWordsId=content.ContentWordsId 
where content.ListId in (select listid 
                         from List 
                         where name='BlackListPageWords')

我得到了这个结果:

enter image description here

我希望在我的应用程序中得到这个结果。如何获得这些结果并列入一个列表,以便我可以在我的应用程序中使用它?

0 个答案:

没有答案