为什么我看不到在我的 DbContext 中添加的存储过程?DbContext 由随 CTP5 版本(带有 POCO 类)引入的模板生成。
我添加了本教程所述的存储过程:http: //thedatafarm.com/blog/data-access/checking-out-one-of-the-new-stored-procedure-features-in-ef4/
此外,我搜索了是否在我的上下文中添加了条目,结果如下:
<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
我错过了什么?
谢谢