I have these to models:
Magazine
public class Magazine
{
[Key]
publicint id { get; set; }
[Required]
public DateTime Time { get; set; }
public virtual MagazineType Type { get; set; }
}
and
public class MagazineType
{
[Key]
public int id { get; set; }
[Required]
publicstring Name { get; set; }
public virtual List<Magazine> Magazines { get; set; }
}
And I auto-generated odata controllers using VS
<EntityType Name="MagazineType">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.Int32" Nullable="false"/>
<Property Name="Name" Type="Edm.String" Nullable="false"/>
<NavigationProperty Name="Magazines" Type="Collection(PMDB.Models.Magazine)"/>
</EntityType>
<EntityType Name="Magazine">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.Int32" Nullable="false"/>
<Property Name="Time" Type="Edm.DateTimeOffset" Nullable="false"/>
<NavigationProperty Name="Type" Type="PMDB.Models.MagazineType"/>
</EntityType>
And this is my metadata. When I debug from the controller calling the Api it hits the function it's supposed to. I am sure that data comes from the DB. However, a blank page appears with no error or data.
Regards.
Update:
In the inspect element section it gives this error:
Failed to load resource: the server responded with a status of 406 (Not Acceptable)