Elimnating repository pattern
This commit is contained in:
@@ -6,26 +6,26 @@ using Venues.Entities;
|
||||
|
||||
namespace Venues.DbContexts
|
||||
{
|
||||
public partial class MlbGameDayContext : DbContext
|
||||
public partial class VenuesContext : DbContext
|
||||
{
|
||||
public MlbGameDayContext()
|
||||
public VenuesContext()
|
||||
{
|
||||
}
|
||||
|
||||
public MlbGameDayContext(DbContextOptions<MlbGameDayContext> options)
|
||||
public VenuesContext(DbContextOptions<VenuesContext> options)
|
||||
: base(options)
|
||||
{
|
||||
}
|
||||
|
||||
public virtual DbSet<Venue> Venues { get; set; } = null!;
|
||||
|
||||
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
//{
|
||||
// if (!optionsBuilder.IsConfigured)
|
||||
// {
|
||||
// optionsBuilder.UseNpgsql("Host=localhost;Database=mlb-game-day;Username=postgres;Password=postgres");
|
||||
// }
|
||||
//}
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||
{
|
||||
if (!optionsBuilder.IsConfigured)
|
||||
{
|
||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5460;Database=venues;Username=postgres;Password=postgres");
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
Reference in New Issue
Block a user