Exemplo n.º 1
0
        public IUnitOfWork GetUnitOfWork(DataBaseSelector dataBaseSelector)
        {
            //if (dataBaseSelector == DataBaseSelector.SqlServer)
            //{
            //    return new SqlServerUnitOfWork(_chinookSqlContext);
            //}
            //return new MySqlUnitOfWork(_chinookMySqlContext);

            return(_unitOfWorks.First(x => x.DataBaseSelector == dataBaseSelector));
        }
Exemplo n.º 2
0
        public SqlServerUnitOfWork(ChinookSqlContext context)
        {
            DataBaseSelector = DataBaseSelector.SqlServer;

            Album = new Repository <Album>(context);
        }
Exemplo n.º 3
0
 public IUnitOfWork GetUnitOfWork(DataBaseSelector dataBaseSelector)
 {
     return(_unitOfWorks.First(x => x.DataBaseSelector == dataBaseSelector));
 }
Exemplo n.º 4
0
        public MySqlUnitOfWork(ChinookMySqlContext context)
        {
            DataBaseSelector = DataBaseSelector.MySql;

            Album = new Repository <Album>(context);
        }