inventory working :D
This commit is contained in:
@@ -19,6 +19,8 @@ namespace PetCompanion.Repositories
|
||||
.Where(p => p.UserId == userId)
|
||||
.Include(p => p.Stats)
|
||||
.Include(p => p.Resources)
|
||||
.Include(p => p.Inventory)
|
||||
.Include(p => p.EquippedItemsList)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
@@ -28,6 +30,8 @@ namespace PetCompanion.Repositories
|
||||
.Where(p => p.Id == petId && p.UserId == userId)
|
||||
.Include(p => p.Stats)
|
||||
.Include(p => p.Resources)
|
||||
.Include(p => p.Inventory)
|
||||
.Include(p => p.EquippedItemsList)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
@@ -41,6 +45,12 @@ namespace PetCompanion.Repositories
|
||||
public Pet UpdatePet(Pet pet)
|
||||
{
|
||||
context.Pets.Update(pet);
|
||||
|
||||
if (pet.Inventory != null)
|
||||
{
|
||||
context.Inventories.Update(pet.Inventory);
|
||||
}
|
||||
|
||||
context.SaveChanges();
|
||||
return pet;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user