我正在开发小型应用程序,在 Entity Framework Core 中组织酒店预订。我需要添加有关每个房间的床位数量和类型的信息。我在想,我决定枚举列表比将其存储在单独的表中更好。但我不知道如何实现它
public enum Bed
{
Single = 1,
Double = 2,
}
public class Room : IEntity
{
[Key]
public int Id { get; set; }
public string RoomIdentifier { get; set; }
public ICollection<Bed> Beds { get; set; }
public int Floor { get; set; }
public double Price { get; set; }
public bool IsFree { get; set; }
public bool IsOutOfService { get; set; }
public bool ShouldBeCleaned { get; set; }
public …Run Code Online (Sandbox Code Playgroud)