예제 #1
0
        public static T CreateRepositoryService <T>(string key)
        {
            string filename = GetAssemblyPath() + GetRepositoryConfigPath();
            FactoryConfigurationItem item = GetFactoryConfirationItemByKey(filename, key);

            if (item != null)
            {
                T dllObject = (T)Com.Wiseape.Utility.Assembly.LoadObject(filename, item.ClassName);
                return(dllObject);
            }

            return(default(T));
        }
예제 #2
0
        public static object Create(string key)
        {
            FactoryConfigurationItem item = GetFactoryConfigurationByKey(key);

            if (item == null)
            {
                throw new FactoryNoConfigurationException(key);
            }
            string dllFile   = BaseFactory.LibraryPath + "\\" + item.DllName;
            string className = item.ClassName;
            string path      = HostingEnvironment.MapPath("~/" + dllFile);
            object obj       = Com.Wiseape.Utility.Assembly.LoadObject(path, className);

            return(obj);
        }