You are on page 1of 1

using Microsoft.AspNetCore.Identity.

EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Soccer.Web.Data.Entities;

namespace Soccer.Web.Data
{
public class DataContext : IdentityDbContext<UserEntity>
{
public DataContext(DbContextOptions<DataContext> options) : base(options)
{

protected override void OnModelCreating(ModelBuilder builder)


{
base.OnModelCreating(builder);

builder.Entity<TeamEntity>()
.HasIndex(t => t.Name)
.IsUnique();
}

public DbSet<GroupDetailEntity> GroupDetails { get; set; }

public DbSet<GroupEntity> Groups { get; set; }

public DbSet<MatchEntity> Matches { get; set; }

public DbSet<PredictionEntity> Predictions { get; set; }

public DbSet<TeamEntity> Teams { get; set; }

public DbSet<TournamentEntity> Tournaments { get; set; }

}
}

You might also like