예제 #1
0
 private static void AddCountries(EFDatabaseContext context, IConfiguration configuration)
 {
     if (!context.Countries.Any())
     {
         context.Countries.Add(new Core.Entities.Country()
         {
             Name     = "Turkey",
             Culture  = "tr-TR",
             Weekends = "Monday,Saturday"
         });
         context.Countries.Add(new Core.Entities.Country()
         {
             Name     = "United Kingdom",
             Culture  = "en-GB",
             Weekends = "Monday,Saturday"
         });
         context.Countries.Add(new Core.Entities.Country()
         {
             Name     = "Dubai",
             Culture  = "ar-AE",
             Weekends = "Friday,Saturday" //Diğer ülkele göre farklı olması
         });
         context.SaveChanges();
     }
 }
예제 #2
0
 public static void Migrate(EFDatabaseContext context)
 {
     context.Database.Migrate();
 }
예제 #3
0
 public static void Initialize(EFDatabaseContext context, IConfiguration configuration)
 {
     AddCountries(context, configuration);
 }
예제 #4
0
 public EFRepositoryBase(EFDatabaseContext dbContext)
 {
     this.dbContext = dbContext;
     this.Table     = dbContext.Set <T>();
 }