I am creating a class that will be the structure that will always return all services (asynchronous calls)
public class RespuestaServicio
{
public bool IsSuccess { get; set; }
public string Error { get; set; }
public int Codigo { get; set; }
public string Excepcion { get; set; }
public Object Resulto { get; set; }
}
It is assumed that the variable Result must have the information that must be returned by the sevice method (List, string, bool, Object etc)
When I call the service and the result variable is a List for example give this error
Error generating the XML document. --- > The type System.Collections.Generic.List 'can not be used in this context.
Try with an array and also, when it is a string or bool it does not give problem, I do not know if this can be done.
How could I solve this? or what alternative could you use to return both the data and the error objection without using variable by reference ?
NOTE : In the client when calling service, it is locked in another method that uses async and await, so it can not use parameters by reference
There is something I do not specify and I think some of those who respond to me were confused.
The Service Response class is a class in webservice, it is where I store the response to send to the client. and when in the answer I assign a list gives error