Beispiel #1
0
        public string GenericInstanceFunction <TArg1, TArg2>()
            where TArg1 : new()
            where TArg2 : new()
        {
            var arg1 = new TArg1();
            var arg2 = new TArg2();

            return($"Hello from instance generic method arg1:{arg1.ToString()} arg2:{arg2.ToString()}");
        }
Beispiel #2
0
        public static void GenericStaticFunction <TArg1, TArg2>()
            where TArg1 : new()
            where TArg2 : new()
        {
            var arg1 = new TArg1();
            var arg2 = new TArg2();

            StaticProperty = $"Hello from static generic command arg1:{arg1.ToString()} arg2:{arg2.ToString()}";
        }
Beispiel #3
0
        public static string GenericStaticFunctionWithReturnValue <TArg1, TArg2>()
            where TArg1 : new()
            where TArg2 : new()
        {
            var arg1 = new TArg1();
            var arg2 = new TArg2();

            return($"Hello from static generic command arg1:{arg1} arg2:{arg2}");
        }
Beispiel #4
0
        public void GenericInstanceFunction <TArg1, TArg2>()
            where TArg1 : new()
            where TArg2 : new()
        {
            var arg1 = new TArg1();
            var arg2 = new TArg2();

            Output = $"Hello from instance generic command arg1:{arg1.ToString()} arg2:{arg2.ToString()}";
        }