我想做什么?
我正在向我的C#Backend(MSSQL + EF6)发送API调用,
http://localhost:56680/api/Booking/Countries
Run Code Online (Sandbox Code Playgroud)
此API调用的关注点是从我的数据库中获取国家/地区.
我从我的数据库中包含屏幕截图的原因是因为汽车是这里的麻烦制造者.
国家和汽车彼此之间有许多关系,由CountryCars(基本上是Vignettes)代表.
这些是相应的域模型:
Car.cs
public class Car
{
public int Id { get; set; }
public Guid GUID { get; set; }
public string Model { get; set; }
public virtual VehicleType VehicleType { get; set; }
public virtual Location Location { get; set; }
[StringLength(255)]
[Index(IsUnique=true)]
public string LicensePlate { get; set; }
public int NrOfSeats { get; set; }
public Equipment Equipment { get; set; }
public virtual ICollection<Country> Vignette { get; …Run Code Online (Sandbox Code Playgroud)