First of all, I've searched for solutions but maybe I've not done it well because I might be missing some concepts.
So my problem: I'm developing an application to work with a database, using Entity Framework. I create the model using "EF Designer from database", import all tables, functions and stored procedures. The problem comes next. When C# generates the code, it also generates class like "storedProcedureName_Result" which, as the name says, is the result of the stored procedure. C# generates code like:
public virtual ObjectResult<uSP_ListSpecialities_Result> uSP_ListSpecialities()
{
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<uSP_ListSpecialities_Result>("uSP_ListSpecialities");
}
and without the result :
public virtual ObjectResult<Nullable<int>> uSP_ListAvailableMedicBi()
{
return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Nullable<int>>("uSP_ListAvailableMedicBi");
}
I need to use those results but C# does not generate those results to all the stored procedures. And that's my problem, I've no idea why.
e.g : This Stored Procedure generates the result class:
CREATE PROCEDURE uSP_ListSpecialities
AS
BEGIN
SELECT id, nome
FROM Especialidade
END
it generates an uSP_ListSpecialities_Result class
but this one doesn't:
CREATE PROCEDURE uSP_ListAvailableMedicBi
AS
BEGIN
SELECT P.biPessoa
FROM Pessoa P
LEFT JOIN Medico M
ON( M.biPessoa = P.biPessoa)
WHERE M.biPessoa IS NULL
END
I ran both on SQLSMS and both returned what's supposed.
Thank you in advance
