I have a WCF method which returns me an array of custom objects like “users”, “roles”, or something else, and it has page output. WCF method has out parameter, stored procedure select rows and return total records of all rows(not only selected), than i read return value in out parameter. But there is one problem i call WCF-method in lambda expression:
var client = MySvcRef.MySvcClient();
var assistant = FormsAuthenticationAssistant();
var result = assistant.Execute<MySvcRef.UserClass[]>(
() => client.GetAllUsers(out totalRecords, pageIndex, pageSize),
client.InnerChannel);
what better solution for my example?
I haven’t tried lambdas with out parameters but normally you just need to declare the variable beforehand:
Edit:
Your best bet may by to wrap
GetAllUserswith a separate class that can use theoutparam: