Below are the model classes. The database and tables were created properly. I can post some tested data to them through postman, but I get the Multiplicity constraint violated error when retrieving all the data from the table as shown in the picture below. In one-to-many relationship in my other applications, everything works as expected.
public class Quote
{
public Quote()
{
Outlet = new Outlet();
}
public int Id { get; set; }
public string RefNumber { get; set; }
public string Status { get; set; }
public string Name { get; set; }
public string DeliveryAddress { get; set; }
public DateTime DeliveryDate { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
public string Comment { get; set; }
public DateTime Date { get; set; }
public virtual Outlet Outlet { get; set; }
}
public class Outlet
{
public Outlet()
{
Inlets = new List<Inlet>();
}
[ForeignKey("Quote")]
public int Id { get; set; }
public int OutletAngle { get; set; }
public int OutletSize { get; set; }
public string OutletType { get; set; }
public virtual Quote Quote { get; set; }
public ICollection<Inlet> Inlets { get; set; }
}
public class Inlet
{
public int Id { get; set; }
public int InletAngle { get; set; }
public int InletSize { get; set; }
public string InletType { get; set; }
}
}