Wednesday, December 26, 2007 1:28 AMI'm using Visual Studio 2008 RTM.
When i'm drag'n'drop a stored procedure into the dbml designer, it generates a method with a generic ISingleResult<SomeClass> type:
public ISingleResult<SomeClass> SearchForSomething([Parameter(DbType="NVarChar(MAX)")] string search)
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), search);
I want to use this stored procedure in advanced LINQ query, efficiently. I could write my own implementation of the generated method with a generic IQueryable<SomeClass> return type, but i'd prefer a setting in the designer, that tells the codegenerator 'make a method with IQueryable return type'. Does this setting exists or i sould write these methods by 'hand'?
Wednesday, December 26, 2007 1:17 PM
Sprocs cannot return an object of type IQueryable (unless you do some custom code under the covers). The best approach to take it to use 'Table Functions', then when you add them to your data context, they can return IQueryable...
Hope this helps and make sense. If you need anything else please say.
Wednesday, December 26, 2007 6:34 PMyes, that makes sense, thx
after i wrote my question, i found this page:
it says what you said.