Have a generic class that inherits from a non-generic class like the structure below:
public class Result
{
public string ErrorCode { get; set;}
public string ErrorMessage { get; set;}
public boo Success { get; set;}
//Lots more properties
public ClientResult ToClientResult()
{
//some pretty involved calculations of error coded and status
}
}
public class Result<T> : Result
{
public T details {get; set;}
public ClientResult<T> ToClientResult<T>()
{
//Need to call the parent class implementation and convert result to generic ver
}
}
My question is how can i call the parent ToClientResult()
and convert the result to the generic version of ClientResult<T>
and then i need to set a property of the ClientResult<T>
to the details property of the Result<T>
class.
I am sure i am missing an easy solution here, i really dont want to duplicate the parent class logic as it is pretty complicated.