i am writing OData service which is built on WebApi asp.net, i am building my own EDM
ODataModelBuilder builder = new ODataModelBuilder();
builder.Namespace = "Models";
EntitySetConfiguration<Incident> incident = builder.EntitySet<Incident>("Incidents");
incident.EntityType.HasKey(c => c.IncidentID);
incident.EntityType.Property(c => c.Name);
incident.EntityType.Property(c => c.IncidentType);
incident.EntityType.Property(c => c.Description);
incident.HasIdLink(eic =>
{
return eic.GenerateSelfLink(false);
}, false);
var hasManyComments = incident.EntityType.HasMany(c => c.IncidentComments);
incident.HasNavigationPropertyLink(hasManyComments, (z, y) =>
{
return z.GenerateNavigationPropertyLink(y, false);
}, false);
EntitySetConfiguration<IncidentComment> incidentComment = builder.EntitySet<IncidentComment>("IncidentComments");
incidentComment.EntityType.HasKey(c => c.CommentID);
incidentComment.EntityType.Property(c => c.IncidentID);
incidentComment.EntityType.Property(c => c.Content);
incidentComment.HasIdLink(eic =>
{
return eic.GenerateSelfLink(false);
}, false);
i am testing as client both BreezeJS and wcf data client. when i am trying to get Incident in the network i see that both the incident properties are passed and the comments how ever in the wcf client i get empty collection of comments and also for the Breeze testing, i suspect that the metadata is incorrect, what am i missing
ODataConventionModelBuilder modelBuilder = new ODataConventionModelBuilder(); var incidents = modelBuilder.EntitySet<Incident>("Incidents"); var comments = modelBuilder.EntitySet<Incident>("IncidentComment");- Kiran Challaproducts.EntityType.Ignore(prd => prd.ReleaseDate);- Kiran Challa