///<summary> /// Alternate constructor for the in-memory data store where the DataStore to be used is passed in. ///</summary> ///<param name="dataStore">The Data Store to be used.</param> public DataAccessorInMemory(DataStoreInMemory dataStore) { _dataStore = dataStore; _businessObjectLoader = new BusinessObjectLoaderInMemory(_dataStore); }
///<summary> /// The constructor for relational database data accessor. Sets up the appropriate /// Business object loader for the databse using the current connection string. ///</summary> public DataAccessorDB() { _databaseConnection = DatabaseConnection.CurrentConnection; _businessObjectLoader = new BusinessObjectLoaderDB(_databaseConnection); }
///<summary> /// The constructor for relational database data accessor. Sets up the appropriate /// Business object loader for the databse using the current connection string. ///</summary> public DataAccessorDB(IDatabaseConnection databaseConnection) { _databaseConnection = databaseConnection; _businessObjectLoader = new BusinessObjectLoaderDB(databaseConnection); }
///<summary> /// registered a specific Business Object loader with a specified Object Type. /// When any object of this type is loaded in future it will be loaded with this. /// Loader. This allows you to have business objects loaded from Different sources. /// e.g. Different databases XML and Databases etc. /// The a loader is not registered for a specific type then the default loader will be used. ///</summary> ///<param name="type"></param> ///<param name="businessObjectLoader"></param> public void AddBusinessObjectLoader(Type type, IBusinessObjectLoader businessObjectLoader) { _businessObjectLoaders.Add(type, businessObjectLoader); }
///<summary> /// Creates this Loader with a default loader. /// This will be used in cases where there is not a specific loader registered. ///</summary> ///<param name="defaultBusinessObjectLoader"></param> public BusinessObjectLoaderMultiSource(IBusinessObjectLoader defaultBusinessObjectLoader) { _defaultBusinessObjectLoader = defaultBusinessObjectLoader; _businessObjectLoaders = new Dictionary <Type, IBusinessObjectLoader>(); }