#27 added userTransactions
This commit is contained in:
@@ -12,10 +12,19 @@ public class ApplicationDbContext(
|
||||
: IdentityDbContext<ApplicationUser>(options), IApplicationDbContext
|
||||
{
|
||||
public DbSet<FutureCreator> FutureCreators => Set<FutureCreator>();
|
||||
public DbSet<UserTransaction> UserTransactions => Set<UserTransaction>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
// Relationship between ApplicationUser and UserTransaction
|
||||
builder.Entity<UserTransaction>()
|
||||
.HasOne<ApplicationUser>()
|
||||
.WithMany()
|
||||
.HasForeignKey(ut => ut.ApplicationUserId)
|
||||
.IsRequired();
|
||||
|
||||
builder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user