表之间的关系分为一对多,多对多,一对一三种,实质就是对外键进行配置。

    一、一对多

    1. Required

        Destination包含Lodging>的集合。

public class Destination
{
public int DestinationId { get; set; }
public string Name { get; set; }
public string Country { get; set; }
public string Description { get; set; }
public byte[] Photo { get; set; }
public List<Lodging> Lodgings { get; set; }
}
public class Lodging
{
public int LodgingId { get; set; }
public string Name { get; set; }
public string Owner { get; set; }
public bool IsResort { get; set; }
public decimal MilesFromNearestAirport { get; set; }
public Destination Destination { get; set; }
}
View Code

相关文章:

  • 2022-12-23
  • 2021-07-04
  • 2021-12-02
  • 2022-02-19
  • 2021-06-02
  • 2021-07-24
猜你喜欢
  • 2021-12-13
  • 2021-11-17
  • 2021-10-29
  • 2021-06-24
相关资源
相似解决方案