Please see the JSON generated below:
I am using latest version of LLBLGEN with the attributes (DataContract/DataMember etc..) from this URL:
https://www.llblgen.com/documentation/4.0/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Adapter/Distributed%20systems/gencode_webservices.htm
My code is dirt simple from the LINQ example...
public IEnumerable<SearchContentEntity> GetSearchContent2()
{
using (var adapter = new DataAccessAdapter())
{
var metaData = new LinqMetaData(adapter);
return metaData.SearchContent.WithPath(p => p.Prefetch(x => x.SearchContentType)).ToList();
}
}
When the data comes back it is adding a Contents property under SearchContentType which contains a full reference of all of the parent types that match that ID. When I receive those I cannot parse them into my model. The entities are buried under the type so they show up blank.
Here is the JSON
Is there a way to generate the Entities so that everything is essentially in-line?
Thanks in advance for any advice/guidance!
[
{
"$id": "1",
"Enabled": true,
"SearchContentAuthor": "neww",
"SearchContentEffectiveEndDate": null,
"SearchContentEffectiveStartDate": null,
"SearchContentId": 9,
"SearchContentPubDate": "2014-06-10T16:08:32.217",
"SearchContentShortDesc": "http://localhost/Fulltext.MVC/GIS/Viewer/index.html?layerName=PUBLIC_SCHOOLS&serviceName=Adminstrative",
"SearchContentSortOrder": 2,
"SearchContentText": "1",
"SearchContentTitle": "Public Schools Updated ",
"SearchContentTypeId": 2,
"SearchContentType": {
"$id": "2",
"SearchContentTypeDesc": "Updated",
"SearchContentTypeId": 2,
"SearchContents": [
{
"$ref": "1"
},
{
"$id": "3",
"Enabled": true,
"SearchContentAuthor": "NONE",
"SearchContentEffectiveEndDate": null,
"SearchContentEffectiveStartDate": null,
"SearchContentId": 10,
"SearchContentPubDate": "2014-06-10T16:08:32.217",
"SearchContentShortDesc": "http://localhost/Fulltext.MVC/GIS/Viewer/index.html?layerName=PUBLIC_SCHOOLS&serviceName=Adminstrative",
"SearchContentSortOrder": 3,
"SearchContentText": "2",
"SearchContentTitle": "Public Schools Updated",
"SearchContentTypeId": 2,
"SearchContentType": {
"$ref": "2"
}
},
{
"$id": "4",
"Enabled": true,
"SearchContentAuthor": "",
"SearchContentEffectiveEndDate": null,
"SearchContentEffectiveStartDate": null,
"SearchContentId": 11,
"SearchContentPubDate": "2014-06-10T16:08:32.217",
"SearchContentShortDesc": "http://localhost/Fulltext.MVC/GIS/Viewer/index.html?layerName=PUBLIC_SCHOOLS&serviceName=Adminstrative",
"SearchContentSortOrder": 4,
"SearchContentText": "3",
"SearchContentTitle": "Public Schools Updated",
"SearchContentTypeId": 2,
"SearchContentType": {
"$ref": "2"
}
},
{
"$id": "5",
"Enabled": true,
"SearchContentAuthor": "",
"SearchContentEffectiveEndDate": null,
"SearchContentEffectiveStartDate": null,
"SearchContentId": 12,
"SearchContentPubDate": "2014-06-10T16:08:32.217",
"SearchContentShortDesc": "http://localhost/Fulltext.MVC/GIS/Viewer/index.html?layerName=PUBLIC_SCHOOLS&serviceName=Adminstrative",
"SearchContentSortOrder": 5,
"SearchContentText": "4",
"SearchContentTitle": "Public Schools Updated",
"SearchContentTypeId": 2,
"SearchContentType": {
"$ref": "2"
}
}
]
}
},
{
"$ref": "3"
},
{
"$ref": "4"
},
{
"$ref": "5"
},
{
"$id": "6",
"Enabled": true,
"SearchContentAuthor": "",
"SearchContentEffectiveEndDate": null,
"SearchContentEffectiveStartDate": null,
"SearchContentId": 13,
"SearchContentPubDate": "2014-06-10T16:08:32.217",
"SearchContentShortDesc": "http://localhost/Fulltext.MVC/GIS/Viewer/index.html?layerName=PUBLIC_SCHOOLS&serviceName=Adminstrative",
"SearchContentSortOrder": 6,
"SearchContentText": "5",
"SearchContentTitle": "Public Schools Updated",
"SearchContentTypeId": 1,
"SearchContentType": {
"$id": "7",
"SearchContentTypeDesc": "Summary",
"SearchContentTypeId": 1,
"SearchContents": [
{
"$ref": "6"
},
{
"$id": "8",
"Enabled": true,
"SearchContentAuthor": "J. Mock",
"SearchContentEffectiveEndDate": null,
"SearchContentEffectiveStartDate": null,
"SearchContentId": 14,
"SearchContentPubDate": "0001-01-01T00:00:00",
"SearchContentShortDesc": "",
"SearchContentSortOrder": 99,
"SearchContentText": "None",
"SearchContentTitle": "Private Schools Update",
"SearchContentTypeId": 1,
"SearchContentType": {
"$ref": "7"
}
}
]
}
},
{
"$ref": "8"
}
]