Linq Stored Procedure issue

HI all,

I have a problem with Linq and my stored procedures. The error I am getting:

Could not find an implementation of the request pattern for the source type 'int'. "Select" was not found.

Here is the code found in my DBClasses:

[Function(Name="dbo.findahostel_getHostelsByTags")]
public IEnumerable<hostel> findahostel_getHostelsByTags([Parameter(DbType="VarChar(150)")] string tags)
{
    IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), tags);
    return ((IEnumerable<hostel>)(result.ReturnValue));
}

      

Here is my Linq code:

IQueryable<hostel> hostels = from h in db.findahostel_getHostelsByTags_Name(searchQuery)
                                         select h;

      

I cannot find an int reference anywhere.

Matt

+1


a source to share


1 answer


I think the problem is that you are trying to apply result.ReturnValue like IEnumerable<hostel>

and I'm pretty sure ReturnValue is an int. This is what the stored procedure returns, which should not be confused with strings which the stored proc also "returns"



+2


a source







All Articles