static BaseResponse Divide() { var result = new DerivedResponse(); result.Stack = "Hi"; return(result); }
static void Main(string[] args) { Console.WriteLine(Sum().Data); Console.WriteLine(Message().Data); BaseResponse baseResponse = Divide(); if (baseResponse.Status == true) { if (baseResponse is DerivedResponse) { DerivedResponse result = (DerivedResponse)baseResponse; } } Console.Read(); }