27 lines
780 B
C#
27 lines
780 B
C#
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; }
|
|
}
|
|
}
|