コード例 #1
0
        internal static ReaderToModel GetReaderToModel(Type t)
        {
            ReaderToModel ic          = null;
            Type          convertType = null;

            if (!cacheDic.TryGetValue(t, out convertType))
            {
                if (convertType == null)
                {
                    convertType = CreateReaderToModelType(t);
                    if (convertType != null && !cacheDic.ContainsKey(t))
                    {
                        cacheDic[t] = convertType;
                    }
                }
            }

            if (convertType != null)
            {
                ic = Activator.CreateInstance(convertType) as ReaderToModel;
            }

            //assbuilder.Save("Afx.Data.Extensions.Dynamic.dll");

            return(ic);
        }
コード例 #2
0
        private static IModelToParam GetModelToParam(Type t)
        {
            IModelToParam setParam     = null;
            Type          setParamType = null;

            if (!setParamDic.TryGetValue(t, out setParamType))
            {
                if (setParamType == null)
                {
                    setParamType = CreateModelToParamType(t);
                    if (setParamType != null && !setParamDic.ContainsKey(t))
                    {
                        setParamDic[t] = setParamType;
                    }
                }
            }

            if (setParamType != null)
            {
                setParam = Activator.CreateInstance(setParamType) as IModelToParam;
            }

            return(setParam);
        }
コード例 #3
0
        private static IReaderToModel GetReaderToModel(Type t)
        {
            IReaderToModel ic          = null;
            Type           convertType = null;

            if (!cacheDic.TryGetValue(t, out convertType))
            {
                if (convertType == null)
                {
                    convertType = CreateReaderToModelType(t);
                    if (convertType != null && !cacheDic.ContainsKey(t))
                    {
                        cacheDic[t] = convertType;
                    }
                }
            }

            if (convertType != null)
            {
                ic = Activator.CreateInstance(convertType) as IReaderToModel;
            }

            return(ic);
        }