public FilmsController()
        {
            string connectionString =
                "server=localhost;port=3306;database=sakila;userid=DataAccess;pwd=Da.2019.IEGP;sslmode=none";

            dbContext = SakilaDbContextFactory.Create(connectionString);
        }
Ejemplo n.º 2
0
        public ActorsController()
        {
            // string connectionString = "server=localhost;port=3306;database=sakila;userid=admin;pwd=arnoboy11;sslmode=none";
            string connectionString = "server=192.168.100.13;port=3306;database=sakila;userid=admin;pwd=arnoboy11";

            dbContext = SakilaDbContextFactory.Create(connectionString);
        }
Ejemplo n.º 3
0
        public FilmsController()
        {
            string connectionString =
                "server=localhost;port=3306;database=sakila;userid=root;pwd=123456";

            dbContext = SakilaDbContextFactory.Create(connectionString);
        }
Ejemplo n.º 4
0
        private ICityService getCityService()
        {
            DbContextOptions options     = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options;
            SakilaDbContext  ctx         = new SakilaDbContext(options);
            ICityService     cityService = new CityService(ctx);

            return(cityService);
        }
Ejemplo n.º 5
0
        public void testFindById()
        {
            DbContextOptions options     = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options;
            SakilaDbContext  ctx         = new SakilaDbContext(options);
            IFilmService     filmService = new FilmService(ctx);

            Film film = filmService.findById(83);

            Assert.Equal("BLUES INSTINCT", film.Title);
        }
Ejemplo n.º 6
0
        public void testListAll()
        {
            DbContextOptions options     = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options;
            SakilaDbContext  ctx         = new SakilaDbContext(options);
            IFilmService     filmService = new FilmService(ctx);

            List <Film> filmsList = filmService.listAll();

            Assert.Equal(1000, filmsList.Count);
        }
Ejemplo n.º 7
0
        public void testListAll()
        {
            // restauração do banco
            DbContextOptions options = MySqlDbContextOptionsExtensions
                                       .UseMySql(new DbContextOptionsBuilder(), "server=172.16.99.230;userid=root;pwd=1q2w3e4r;port=3308;database=sakila;sslmode=none;").Options;

            SakilaDbContext ctx = new SakilaDbContext(options);

            filmService = new FilmService(ctx);
            var list = filmService.listAll();

            Assert.Equal(1000, list.Count);
            Assert.NotNull(list[45].Language);
        }
Ejemplo n.º 8
0
        public void testSaveOrUpdate_atualizacao()
        {
            DbContextOptions options     = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options;
            SakilaDbContext  ctx         = new SakilaDbContext(options);
            IFilmService     filmService = new FilmService(ctx);

            Film film = new Film()
            {
                Id          = 2,
                Title       = "Filme Teste2",
                Description = "Description2",
                ReleaseYear = 2019
            };

            filmService.saveOrUpdate(film);
            Assert.Equal("Filme Teste2", filmService.findById(2).Title);
        }
Ejemplo n.º 9
0
        public void testSaveOrUpdate_insercao()
        {
            DbContextOptions options     = MySqlDbContextOptionsExtensions.UseMySql(new DbContextOptionsBuilder(), ConnectionString).Options;
            SakilaDbContext  ctx         = new SakilaDbContext(options);
            IFilmService     filmService = new FilmService(ctx);

            Film film = new Film()
            {
                Title       = "Filme Teste",
                Description = "Description",
                ReleaseYear = 2018
            };

            filmService.saveOrUpdate(film);

            Assert.Equal(film, filmService.findById(1001));
            Assert.Equal(1001, filmService.listAll().Count);
        }
Ejemplo n.º 10
0
        public ActorsController()
        {
            string connectionString = "server=localhost;port=3306;database=sakila;userid=root;pwd=ks7r2400;sslmode=none";

            dbContext = SakilaDbContextFactory.Create(connectionString);
        }
Ejemplo n.º 11
0
 public FilmActorsController(SakilaDbContext context)
 {
     _context = context;
 }
 public InventoriesController(SakilaDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 13
0
 public FilmService(SakilaDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Ejemplo n.º 14
0
 public ActorsController(SakilaDbContext dbContext)
 {
     dataBaseContext = dbContext;
 }
 public RentalsController(SakilaDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 16
0
 public CityService(SakilaDbContext ctx)
 {
     this.ctx = ctx;
 }
Ejemplo n.º 17
0
 public CustomerService(SakilaDbContext ctx)
 {
     this.ctx = ctx;
 }
Ejemplo n.º 18
0
 public FilmService(SakilaDbContext ctx)
 {
     this.ctx = ctx;
 }
 public CustomersController(SakilaDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 20
0
 public LanguageService(SakilaDbContext context)
 {
     this.context = context;
 }
Ejemplo n.º 21
0
        public AtorController()
        {
            string connectionString = "server=localhost;port=3306;database=sakila_tiagopassos;userid=root;pwd=;sslmode=none";

            dbContext = SakilaDbContextFactory.Create(connectionString);
        }