static DependencyResolver() { var DALappSetting = ReadSetting("DAL"); if (DALappSetting == "File") { UserDao = new FileUserDao(); AwardDao = new FileAwardDao(); } else if (DALappSetting == "DB") { UserDao = new DBUserDao(); AwardDao = new DBAwardDao(); AccountDao = new DBAccountDao(); AccountLogic = new AccountLogic(AccountDao); } else { UserDao = new MemoryUserDao(); AwardDao = new MemoryAwardDao(); } UserLogic = new UserLogic(UserDao); AwardLogic = new AwardLogic(AwardDao); }
static DaoProvider() { if (ConfigurationManager.AppSettings["DaoMode"] == "DB") { UserDao = new DBUserDao(); SkillDao = new DBSkillDao(); AccountDao = new DBAccountDao(); PhotoDao = new DBPhotoDao(); } }
static DaoProvider() { if (ConfigurationManager.AppSettings["DaoMode"] == "File") { UserDao = new FileUserDao(); AwardDao = new FileAwardDao(); } if (ConfigurationManager.AppSettings["DaoMode"] == "DB") { UserDao = new DBUserDao(); AwardDao = new DBAwardDao(); AccountDao = new DBAccountDao(); } }
static DaoProvider() { switch (ConfigurationManager.AppSettings["db"]) { //case "file": // AwardDao = new FileAwardDao(); // UserDao = new FileUserDao(); // SecurityDao = new FileSecurityDao(); // break; case "sql": AwardDao = new DBAwardDao(); UserDao = new DBUserDao(); //SecurityDao = new DBSecurityDao(); //AvatarDao = new DBAvatarDao(); break; default: throw new InvalidCastException(); } }