/// <summary> /// Inicializa uma instância da classe <see cref="UfBO"/>. /// </summary> public UfBO() : base() { IDAOFactory daoAccess = DAOAccess.GetDAOFactory(); ufDAO = daoAccess.UfDAO(); }
/// <summary> /// Initializes static members of the <see cref="DAOFactoryMethod"/> class. /// </summary> static DAOFactoryMethod() { var currentDataProvider = ConfigurationManager.AppSettings["dataProvider"]; if (string.IsNullOrWhiteSpace(currentDataProvider)) { currentDAOFactory = null; } else { switch (currentDataProvider.ToLower().Trim()) { case "sqlserver": currentDAOFactory = new SQLServerDAOFactory(); break; case "oracle": currentDAOFactory = null; return; default: currentDAOFactory = new SQLServerDAOFactory(); break; } } }
/// <summary> /// Inicializa uma instância da classe <see cref="CidadeBO"/>. /// </summary> public CidadeBO() : base() { IDAOFactory daoAccess = DAOAccess.GetDAOFactory(); cidadeDAO = daoAccess.CidadeDAO(); }
public ProductTagEntity(int productId, int tagId, IDAOFactory daoFactory) { this.ProductId = productId; this.ProductEntity = daoFactory.ProductEntityDAO.Get(productId); this.TagId = tagId; this.TagEntity = daoFactory.TagEntityDAO.Get(tagId); }
/// <summary> /// Get the DAO factory./>. /// </summary> public static IDAOFactory GetDAOFactory() { lock (typeof(DAOAccess)) { if (daoFactory == null) { UnityContainer uc = new UnityContainer(); uc.RegisterType <IDAOFactory, DAOFactory>(); daoFactory = uc.Resolve <DAOFactory>(); } return(daoFactory); } }
public FolderMonitor(IDAOFactory daoFactory) { if (daoFactory == null) throw new ArgumentNullException(nameof(daoFactory)); string directory; int maxDegreeOfParallelism; LoadSettingsFromConfig(out directory, out _directoryForProcessedFiles, out maxDegreeOfParallelism); _daoFactory = daoFactory; _watcher = new FileSystemWatcher(directory) {Filter = "*.csv"}; _directoryNameFormat = new Regex(@"^[A-Z][a-z]{0,29}_\d{8}$"); _cancellationTokenSource = new CancellationTokenSource(); _scheduler = new LimitedConcurrencyLevelTaskScheduler(maxDegreeOfParallelism); }
private void InitDao() { switch (_connectionType) { case "EntityFramework": _daoFactory = new OrmDAOFactory(); break; case "SqLiteQueries": break; default: break; } }
public ConverterFactory(IDomainFactory domainFactory, IEntityFactory entityFactory, IRepositoryFactory repositoryFactory, IDAOFactory daoFactory) { this.domainFactory = domainFactory; this.entityFactory = entityFactory; this.repositoryFactory = repositoryFactory; this.daoFactory = daoFactory; productConverter = new ProductConverter(this.domainFactory, this.repositoryFactory); productEntityConverter = new ProductEntityConverter(entityFactory, daoFactory); stockConverter = new StockConverter(domainFactory, repositoryFactory); stockEntityConverter = new StockEntityConverter(entityFactory, daoFactory); tagConverter = new TagConverter(domainFactory, repositoryFactory); tagEntityConverter = new TagEntityConverter(entityFactory, daoFactory); }
static DAOFactoryMethod() { string currentDataProvider = ConfigurationManager.AppSettings["dataProvider"]; if (String.IsNullOrWhiteSpace(currentDataProvider)) { _currentDAOFactory = null; } else { switch(currentDataProvider.ToLower().Trim()) { case "mysql": _currentDAOFactory = new MySqlDAOFactory(); break; default: _currentDAOFactory = new MySqlDAOFactory(); break; } } }
public ActionResult AbstractFactory(string factoryType) { IDAOFactory factory = null; if (factoryType == "mssql") { factory = new MsSqlFactory(); } else { factory = new MySqlFactory(); } factoryType = "DesignPatterns.Pattern.GangOfFour.Creational.MsSqlFactory"; ObjectHandle oh = Activator.CreateInstance(Assembly.GetExecutingAssembly().FullName, factoryType); factory = (IDAOFactory)oh.Unwrap(); DAOHelper o = new DAOHelper(factory); o.Save(); return(View()); }
public DAOHelper(IDAOFactory factory) { _IDAOFactory = factory; }
public static void InitDAOFactory(IDAOFactory factory) { if (Factorys.daoFactory != null) throw new Exception("dao工厂只能初始化一次!"); Factorys.daoFactory = factory; }
public ProductTagEntity CreateProductTagEntity(int productId, int tagId, IDAOFactory daoFactory) { return(new ProductTagEntity(productId, tagId, daoFactory)); }
public VehicleManager(IDAOFactory daoFactory) { _daoFactory = daoFactory; }
public StockEntityConverter(IEntityFactory entityFactory, IDAOFactory daoFactory) { this.entityFactory = entityFactory; this.daoFactory = daoFactory; }
public ProductEntityConverter(IEntityFactory entityFactory, IDAOFactory daoFactory) { this.entityFactory = entityFactory; this.daoFactory = daoFactory; }