예제 #1
0
        //public BaseContext(IConfiguration configuration)
        //{
        //    _connectionString = configuration.GetConnectionString("DefaultConnection");
        //    Database.EnsureCreated();
        //}

        //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        //{
        //    //optionsBuilder.UseNpgsql(_connectionString, options => options.SetPostgresVersion(new Version(9, 6)));

        //    //base.OnConfiguring(optionsBuilder);

        //    optionsBuilder.UseMySql(_connectionString);

        //    base.OnConfiguring(optionsBuilder);
        //}

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);


            Cliente.Map(modelBuilder);
            Filme.Map(modelBuilder);
            Locacao.Map(modelBuilder);
        }