#27 added userTransactions

This commit is contained in:
Dominic Villemure
2024-04-22 15:55:49 -04:00
parent cbde9838d1
commit b63d53f109
17 changed files with 696 additions and 28 deletions

View File

@@ -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());
}
}