Exemple #1
0
        private void RefMethod <reponse>(ref BClass <reponse> r) where reponse : IGenericInterface
        {
            IBaseInterface <reponse> i = r;
            var result = Object.ReferenceEquals(i, r);

            if (!result)
            {
                throw new Exception("Ref not equal");
            }
            RefMethod(ref i);
        }
Exemple #2
0
        public int BClassWithGenericReponseRefToCallAMethod <response>() where response : IGenericInterface
        {
            var b   = new BClass <response>();
            var gen = (response)Activator.CreateInstance(typeof(response));

            b.SetReponse(gen);
            RefMethod(ref b);

            var aMoop = b.boop();

            return(aMoop);
        }
Exemple #3
0
        public int BClassWithAReponseRefToCallAMethod()
        {
            var b   = new BClass <GenericClassA>();
            var gen = new GenericClassA();

            b.SetReponse(gen);
            RefMethod(ref b);

            var aMoop = b.boop();

            return(aMoop);
        }