I have an Azure SQL database so I created a Microsoft.Search service off it. I want to use that to build a virtual entity. Is this possible? I feel like the fact it wants a source that works, and a separate table name to append on the query, means it won't work.
Given I was getting nowhere, I created a WCF Data Service and it's giving me the OData service I need, but still not working....
I think I know the reason. My JSON response looks like this:
"d": [
{
"__metadata": {
"id": "https://localhost:44317/V4/Odata/Odata.svc/YOYParentContacts(guid'1b9d9acf-77cc-4c37-9735-30946e871d1b')",
"uri": "https://localhost:44317/V4/Odata/Odata.svc/YOYParentContacts(guid'1b9d9acf-77cc-4c37-9735-30946e871d1b')",
"type": "Model.YOYParentContact"
},
"id": "1b9d9acf-77cc-4c37-9735-30946e871d1b",
whereas a data source that works returns JSON like this:
{
"@odata.context": "https://services.odata.org/V4/OData/OData.svc/$metadata#Advertisements",
"value": [
{
"@odata.mediaReadLink": "Advertisements(f89dee73-af9f-4cd4-b330-db93c25ff3c7)/$value",
"@odata.mediaContentType": "*/*",
"@odata.mediaEtag": "\"8zOOKKvgOtptr4gt8IrnapX3jds=\"",
"ID": "f89dee73-af9f-4cd4-b330-db93c25ff3c7",
So it seems reasonable to then assume that the different format JSON being returned by my simple WCF Data Service is the cause of my issue. So my question becomes, using a WCF Data Service, how do I shape the JSON it returns?
Thanks
As long as you have an source and tables of it and you can retrieve data from it your are good to go.
You can either have out of box odata provider or you can create Custom data provider. It is not a big deal, Here is an nice example of how to achieve this