using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace CampusErrand.Models; /// /// 菜品表 /// public class Dish { [Key] public int Id { get; set; } /// 门店 ID public int ShopId { get; set; } /// 菜品名称 [MaxLength(64)] public string Name { get; set; } = string.Empty; /// 菜品照片 [MaxLength(512)] public string Photo { get; set; } = string.Empty; /// 价格 [Column(TypeName = "decimal(10,2)")] public decimal Price { get; set; } /// 是否启用 public bool IsEnabled { get; set; } = true; // 导航属性 [ForeignKey(nameof(ShopId))] public Shop? Shop { get; set; } }