Entity framework 我看不到DbContext中具有POCO类的存储过程

Entity framework 我看不到DbContext中具有POCO类的存储过程,entity-framework,stored-procedures,asp.net-mvc-3,entity-framework-ctp5,Entity Framework,Stored Procedures,Asp.net Mvc 3,Entity Framework Ctp5,为什么我看不到在DbContext中添加的存储过程?DbContext由CTP5发行版中引入的带有POCO类的模板生成 如本教程所述,我添加了存储过程: 此外,我还搜索了条目是否添加到我的上下文中,结果如下: <Function Name="GetClientsForEmailSend" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics

为什么我看不到在DbContext中添加的存储过程?DbContext由CTP5发行版中引入的带有POCO类的模板生成

如本教程所述,我添加了存储过程:

此外,我还搜索了条目是否添加到我的上下文中,结果如下:

<Function Name="GetClientsForEmailSend" Aggregate="false" BuiltIn="false" NiladicFunction="false" IsComposable="false" ParameterTypeSemantics="AllowImplicitConversion" Schema="dbo" />

<FunctionImport Name="GetClientsForEmailSend" EntitySet="Client" ReturnType="Collection(DBMailMarketingModel.Client)" />

<FunctionImportMapping FunctionImportName="GetClientsForEmailSend" FunctionName="DBMailMarketingModel.Store.GetClientsForEmailSend">
类似的问题是:

但我已经做了所有的建议

这是存储过程:

ALTER PROCEDURE GetClientsForEmailSend
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT OFF;

-- Insert statements for procedure here
SELECT *
FROM dbo.Client AS c
INNER JOIN Subscription AS i on c.IDClient = i.IDClient
WHERE c.Email is not null and c.Email <> '' and i.Active = 1
END
GO
我错过了什么


谢谢

DbContext不支持将存储过程映射到方法。您必须使用context.Database.SqlCommand直接调用过程。。。或者context.Database.SqlQuery…

谢谢您的回答。你说得对,但不幸的是我没有收到Expected结果。我想要的结果是加载具有活动订阅的客户端,该订阅具有bool Active,因此如果一个客户端有3个订阅,但是只有2个是活动的,我希望dbcontext只加载latters。我尝试使用上面的sp,存储结果的变量为null,并且在clients let sub=e中使用LINQ var result=from e。Subscriptions其中sub.ToList.FindAlls=>s.active==true.Count>0选择e;你能给我一个解决方案吗?谢谢@stuzzo:加载带有筛选子项的父实体必须使用投影完成。检查此问题: