static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            var resultInt = new Result <int> {
                Success = true, Data = 20
            };
            var resultString = new Result <string> {
                Success = false, Data = "Papa"
            };

            var rp = new ResultPrinter();

            rp.Print(resultInt);
            rp.Print(resultString);


            //Console.WriteLine($"Result 1 Data: {result1.Data.GetType()}\nResult 1 Data2: {result1.Data2.GetType()}");
            //Console.WriteLine();
            //Console.WriteLine($"Result 2 Data: {result2.Data.GetType()}\nResult 2 Data2: {result2.Data2.GetType()}");
        }
示例#2
0
        static void Main(string[] args)
        {
            var result = new Result <int> {
                Succes = true, Data = 5, Data2 = 10
            };
            var result2 = new Result <string> {
                Succes = false, Data = "John"
            };

            var helper = new ResultPrinter();

            helper.Print(result);
        }
示例#3
0
        static void Main(string[] args)
        {
            //var result = new ResultInt { Success = true, Data = 5 };
            //Console.WriteLine(result.Success);
            //Console.WriteLine(result.Data);
            //var result1 = new ResultInt { Success = false, Data = 5 };
            //Console.WriteLine(result1.Success);

            var result = new Result <int, string> {
                Success = true, Data = 5, Data2 = "Hello"
            };
            var result1 = new Result <string, bool> {
                Success = false, Data = "Jhone", Data2 = true
            };

            Console.WriteLine(result.Data2);
            Console.WriteLine(result1.Success);

            var helper = new ResultPrinter();

            helper.Print(result);
        }