Ejemplo n.º 1
0
        public DataSourceHelper(string ConnectionString, DataLayerType DataLayerType, ObjectLayerType ObjectLayerType)
        {
            this._connectionString = ConnectionString;
            this._dataLayerType    = DataLayerType;
            this._objectLayerType  = ObjectLayerType;

            Initialize();
        }
Ejemplo n.º 2
0
        public DataSourceHelper(string ConnectionString, string Database, DataLayerType DataLayerType, ObjectLayerType ObjectLayerType, string[] ObjectLibrary)
        {
            this._connectionString = ConnectionString;
            this._database         = Database;
            this._dataLayerType    = DataLayerType;
            this._objectLibrary    = ObjectLibrary;
            this._objectLayerType  = ObjectLayerType;

            Initialize();
        }
Ejemplo n.º 3
0
        public IDataLayerBase GetDataLayer(DataLayerType tipo)
        {
            switch (tipo)
            {
            case DataLayerType.SqlServer:
            {
                return(new SqlServerDataLayer());
            }

            default:
            {
                throw new Exception($"tipo de DataLayer no reconocido:{tipo}");
            }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets a DataLayer object of the specified type.
        /// </summary>
        /// <param name="type">The type of the DataLayer.</param>
        /// <returns>A DataLayer.</returns>
        public DataLayerBase GetDataLayer(DataLayerType type)
        {
            switch (type)
            {
            case DataLayerType.SqlServer:
            {
                return(SqlServerDataLayer.Instance);
            }

            default:
            {
                throw new Exception(string.Format("Unknown DataLayer type:{0}", type));
            }
            }
        }
Ejemplo n.º 5
0
        public XpoInitializer(IDataStore DataStore, DataLayerType DataLayerType, params Type[] entityTypes)
        {
            this.entityTypes   = entityTypes;
            this.dataLayerType = DataLayerType;
            this.dataStore     = DataStore;
            dictionary         = this.PrepareDictionary(entityTypes);

            switch (DataLayerType)
            {
            case DataLayerType.Simple:
                this.WorkindDal = new SimpleDataLayer(dictionary, DataStore);
                break;

            case DataLayerType.ThreadSafe:
                this.WorkindDal = new ThreadSafeDataLayer(dictionary, DataStore);
                break;
            }
        }
Ejemplo n.º 6
0
 public XpoInitializer(string connectionString, DataLayerType DataLayerType, params Type[] entityTypes)
     : this(XpoDefault.GetConnectionProvider(connectionString, AutoCreateOption.DatabaseAndSchema), DataLayerType, entityTypes)
 {
 }