示例#1
0
        protected ISerializer <T> GetSerializer(Type aliasType)
        {
            if (aliasType == null)
            {
                return(_serializerFactory.Create <T>());
            }

            var method = AliasCreateMethodInfo.MakeGenericMethod(typeof(T), aliasType);

            return((ISerializer <T>)method.Invoke(_serializerFactory, null));
        }
示例#2
0
        protected object GetSerializer(Type itemType, Type aliasType)
        {
            if (aliasType == null)
            {
                var method = CreateMethodInfo.MakeGenericMethod(itemType);

                return(method.Invoke(_serializerFactory, null));
            }

            var aliasMethod = AliasCreateMethodInfo.MakeGenericMethod(itemType, aliasType);

            return(aliasMethod.Invoke(_serializerFactory, null));
        }