In a linq2sql class, I call a stored procedure that returns multiple result sets and it works.
Whenever I add a new procedure in the linq2sql designer and it stealth converts the aforementioned stored procedure from IMultipleResults to ISingleResult in designer.cs.
I replaced the code with a previous version and it works, but why does this happen?
How do I prevent the designer from changing code that works?
Every time I add a new sp, I have to undo what the designer does.
This
[Function(Name="dbo.GetCustomerOrderDetails")]
[ResultType(typeof(GetCustomerOrderSummaryResult))]
[ResultType(typeof(GetOrderLineDetailsResult))]
public IMultipleResults GetCustomerOrderDetails([Parameter(DbType="UniqueIdentifier")] System.Nullable<System.Guid> custGuid, [Parameter(DbType="VarChar(75)")] string email, [Parameter(DbType="Int")] System.Nullable<int> orderId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), custGuid, email, orderId);
return (IMultipleResults)result.ReturnValue;
}
gets changed to this by the linq2sql designer
[Function(Name="dbo.GetOrderLineDetails")]
public ISingleResult<GetOrderLineDetailsResult> GetOrderLineDetails([Parameter(DbType="Int")] System.Nullable<int> orderId)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), orderId);
return ((ISingleResult<GetOrderLineDetailsResult>)(result.ReturnValue));
}
which I eventually undo manually.