I do not see stored procedures in DbContext with POCO classes

Why can't I see the stored procedure added in my DbContext? DbContext is generated by the template introduced with the release of CTP5 (with POCO classes).

I added stored procedures, as stated in this lesson: http://thedatafarm.com/blog/data-access/checking-out-one-of-the-new-stored-procedure-features-in-ef4/

Also, I searched if the entry was added in my context, and these are the results:

<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">

A similar question:

Why doesn't EF4 generate a method to support my import function?

but I made all the suggestions.

This is a stored procedure:

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

What am I missing?

thank

+3
source share
1 answer

DbContext . , context.Database.SqlCommand(...) context.Database.SqlQuery(...)

+5

Source: https://habr.com/ru/post/1793063/


All Articles