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(); } }
public static void Migrate(EFDatabaseContext context) { context.Database.Migrate(); }
public static void Initialize(EFDatabaseContext context, IConfiguration configuration) { AddCountries(context, configuration); }
public EFRepositoryBase(EFDatabaseContext dbContext) { this.dbContext = dbContext; this.Table = dbContext.Set <T>(); }