Esempio n. 1
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity <UserEntity>(new UserMap().Configure);
            modelBuilder.Entity <UfEntity>(new UfMap().Configure);
            modelBuilder.Entity <CepEntity>(new CepMap().Configure);
            modelBuilder.Entity <MunicipioEntity>(new MunicipioMap().Configure);

            UfSeeds.Ufs(modelBuilder);
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity <ClienteEntity>(new ClienteMap().Configure);

            modelBuilder.Entity <UfEntity>(new UfMap().Configure);
            modelBuilder.Entity <MunicipioEntity>(new MunicipioMap().Configure);
            modelBuilder.Entity <EnderecoEntity>(new EnderecoMap().Configure);

            UfSeeds.Ufs(modelBuilder);
        }
Esempio n. 3
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity <UserEntity>(new UserMap().Configure);
            modelBuilder.Entity <UfEntity>(new UfMap().Configure);
            modelBuilder.Entity <MunicipioEntity>(new MunicipioMap().Configure);
            modelBuilder.Entity <CepEntity>(new CepMap().Configure);

            modelBuilder.Entity <UserEntity>().HasData(new UserEntity()
            {
                Id       = Guid.NewGuid(),
                Name     = "Administrador",
                Email    = "*****@*****.**",
                CreateAt = DateTime.Now,
                UpdateAt = DateTime.Now
            });

            UfSeeds.Ufs(modelBuilder);
        }
Esempio n. 4
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity <UserEntity>(new UserMap().Configure);
            modelBuilder.Entity <UfEntity>(new UfMap().Configure);
            modelBuilder.Entity <MunicipioEntity>(new MunicipioMap().Configure);
            modelBuilder.Entity <CepEntity>(new CepMap().Configure);

            //add user default
            modelBuilder.Entity <UserEntity>().HasData(
                new UserEntity
            {
                Id       = Guid.NewGuid(),
                Name     = "adm",
                Email    = "*****@*****.**",
                CreateAt = DateTime.UtcNow,
                UpdateAt = DateTime.UtcNow,
            }
                );

            UfSeeds.Ufs(modelBuilder);
        }