Add action gathering functionality: implement ActionGathered model and repository, update Pet model and services, and enhance GameItemsRepository with item retrieval methods.
This commit is contained in:
@@ -18,6 +18,7 @@ namespace PetCompanion.Data
|
||||
public DbSet<GameItem> GameItems { get; set; }
|
||||
public DbSet<Inventory> Inventories { get; set; }
|
||||
public DbSet<EquippedItem> EquippedItems { get; set; }
|
||||
public DbSet<ActionGathered> ActionGathered { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
@@ -66,6 +67,17 @@ namespace PetCompanion.Data
|
||||
.WithMany()
|
||||
.HasForeignKey(e => e.GameItemId);
|
||||
|
||||
modelBuilder.Entity<ActionGathered>()
|
||||
.HasOne(ag => ag.Pet)
|
||||
.WithMany(p => p.ActionGathered)
|
||||
.HasForeignKey(ag => ag.PetId)
|
||||
.OnDelete(DeleteBehavior.Cascade);
|
||||
|
||||
modelBuilder.Entity<ActionGathered>()
|
||||
.HasOne(ag => ag.GameItem)
|
||||
.WithMany()
|
||||
.HasForeignKey(ag => ag.ItemId);
|
||||
|
||||
// Seed initial data
|
||||
var skills = SkillsData.GetInitialSkillsWithoutRelations();
|
||||
var requirements = SkillsData.GetInitialSkillRequirements();
|
||||
|
Reference in New Issue
Block a user