breezejs: navigation property not added to entity

后端 未结 1 669
无人共我
无人共我 2021-01-24 10:17

I\'ve configured my WebAPI ODATA service (using 5.0.0-rc1 for $expand and $select support) and everything seems to work fine but navigation properties.

The metadata does

相关标签:
1条回答
  • 2021-01-24 10:37

    You must define a foreign key as Breeze associations require FKs. http://www.breezejs.com/documentation/navigation-properties

    [EDIT]

    Your bi-directional association should look like this:

     public class Mandate
    {
        public int Id { get; set; }
        public string PolicyNumber { get; set; }
    
        public virtual  ICollection<OpenPosition> OpenPositions { get; set; }
    }
    
    public class OpenPosition {
        public int Id { get; set; }
        public decimal Amount { get; set; }
    
        public int MandateId { get; set; }
        public Mandate Mandate {get; set; }
    }
    
    0 讨论(0)
提交回复
热议问题