示例#1
0
        /// <summary>
        /// 创建数据层接口(DALFactory中定义的)
        /// </summary>
        public static IDALClass <T> CreateDALClass <T>(string DbConnectionName)
        {
            Type   type         = typeof(T);
            var    setting      = ConfigurationManager.Configuration.GetSection($"ConnectionStrings:{DbConnectionName}");
            string assemblyName = "SqlServerDAL";
            string typeName     = string.Format("{0}.DALClass`1[[{1}]]", assemblyName, type.AssemblyQualifiedName);

            Console.WriteLine("CreateDALClass:" + typeName);
            IDALClass <T> objType = (IDALClass <T>)CreateObject(setting, typeName, assemblyName);

            return(objType);
        }
示例#2
0
 public void InitDAL(string DbConnectionName)
 {
     dal = DataAccess.CreateDALClass <T>(DbConnectionName);
 }
示例#3
0
 public CommandCollection(IDALClass executequerys)
 {
     _dalClass = executequerys;
 }
示例#4
0
 public Command(IDALClass dalClass)
 {
     _dalClass = dalClass;
 }