Пример #1
0
        static void Main(string[] args)
        {
            ProgramMode mode     = ConfigHelper.GetProGramType();
            IDbExcute   dbExcute = DbExcuteFactory.CreateDbExcute(mode);

            dbExcute.ExcuteDbMethod();
        }
Пример #2
0
 public SQLInstance(string Name, Dictionary <string, List <PropertyInfo> > pro, string ConnectionString)
 {
     this.name             = Name;
     this.connectionString = ConnectionString;
     conn     = new SqlConnection(ConnectionString);
     this.pro = pro;
     excute   = new SQLExcute(conn, pro);
 }
Пример #3
0
        public static IDbExcute CreateDbExcute(ProgramMode mode)
        {
            string    name     = Enum.GetName(typeof(ProgramMode), mode);
            Assembly  assembly = Assembly.GetExecutingAssembly(); // 获取当前程序集
            IDbExcute dbExcute = (IDbExcute)assembly.CreateInstance($"MyWebApiProject.DbToJsonFileTool.Service.{name}");

            return(dbExcute);
        }