Exemple #1
0
        public static void Seed(IApplicationBuilder app)
        {
            TelefonRehberiContext context = app.ApplicationServices.GetRequiredService <TelefonRehberiContext>();


            context.Database.Migrate();


            if (!context.Departmanlar.Any())
            {
                context.Departmanlar.AddRange(
                    new Departman()
                {
                    DepartmanAdi = "IT"
                }

                    );
                context.SaveChanges();
            }

            if (!context.Calisanlar.Any())
            {
                context.Calisanlar.AddRange(
                    new Calisan()
                {
                    CalisanAdi = "Samet", CalisanSoyadi = "Irkoren", Telefon = "05059799591", YoneticiId = 1, DepartmanId = 1
                }



                    );
                context.SaveChanges();
            }
        }
 public EfCalisanRepository(TelefonRehberiContext _context)
 {
     context = _context;
 }
 public EfDepartmanRepository(TelefonRehberiContext _context)
 {
     context = _context;
 }
Exemple #4
0
 public EfAdminRepository(TelefonRehberiContext _context)
 {
     context = _context;
 }