Breeze ODataException without $expand option

徘徊边缘 提交于 2020-01-05 17:45:15

问题


We are two developers (one with Windows Server 2008 R2 and the other with Windows 8) that working on same project (on TFS with Visual Studio 2013 and with the last nuget packages like Breeze 1.4.11 installed), but with different results on breeze query execution.

With Windows Server 2008 R2 we must add $expand option otherwise we have an error

Only properties specified in $expand can be traversed in $select query options

, conversely with Windows 8 the query run successfully without $expand option, why?

query with$expand:

/breeze/breeze/Udc_Testata?$filter=Id_Tipo_Udc eq 'A'&$orderby=Id_Udc&$top=100&$expand=FK_Udc_Testata_Tipo_Udc%2CFK_Udc_Posizione_Udc_Testata%2FFK_Udc_Posizione_Partizioni&$select=Codice_Udc%2CFK_Udc_Testata_Tipo_Udc%2FDescrizione%2CFK_Udc_Posizione_Udc_Testata%2FFK_Udc_Posizione_Partizioni%2FDescrizione&$inlinecount=allpages

query without $expand:

/breeze/breeze/Udc_Testata?$filter=Id_Tipo_Udc eq 'A'&$orderby=Id_Udc&$top=100&$select=Codice_Udc%2CFK_Udc_Testata_Tipo_Udc%2FDescrizione%2CFK_Udc_Posizione_Udc_Testata%2FFK_Udc_Posizione_Partizioni%2FDescrizione&$inlinecount=allpages

Thanks


回答1:


Standard OData queries require the $expand option. However, if you decorate your Breeze ApiController with the BreezeControllerAttribute, Breeze will understand the query even if you don't specify the $expand.

So it sounds like the Windows Server 2008 R2 doesn't have a 'Breeze friendly' controller.



来源:https://stackoverflow.com/questions/23268072/breeze-odataexception-without-expand-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!