not working inventory :c

This commit is contained in:
2025-02-04 17:47:18 -03:00
parent f234b5d84d
commit 7a2c3d2f67
22 changed files with 2713 additions and 49 deletions

26
Models/Inventory.cs Normal file
View File

@@ -0,0 +1,26 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace PetCompanion.Models
{
public class Inventory
{
[Key, ForeignKey("Pet")]
public string PetId { get; set; }
[JsonIgnore]
public virtual Pet Pet { get; set; }
public virtual ICollection<InventoryItem> Items { get; set; } = new List<InventoryItem>();
public int Capacity { get; set; } = 20;
}
public class InventoryItem
{
[Key]
public int Id { get; set; }
public string InventoryId { get; set; }
public int GameItemId { get; set; }
public virtual GameItem GameItem { get; set; }
public int Quantity { get; set; }
}
}