Query in SQL view "viewProduktivnostPloce" is simple select query without WHERE condition. My goal is to filter this query on RowExpand event (please correct me if I'm wrong). Bellow you can find JSON response:
{"error":{"code":"","message":"The query specified in the URI is not valid. Could not find a property named 'ViewProduktivnostPloces' on type 'Petroprojekt.Models.Petroprojekt.ViewProduktivnostPloce'.","details":[],"innererror":{"message":"Could not find a property named 'ViewProduktivnostPloces' on type 'Petroprojekt.Models.Petroprojekt.ViewProduktivnostPloce'.","type":"Microsoft.OData.ODataException","stacktrace":" at Microsoft.OData.UriParser.SelectExpandBinder.GenerateExpandItem(ExpandTermToken tokenIn)\r\n at System.Linq.Enumerable.SelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext()\r\n at System.Collections.Generic.List1.AddEnumerable(IEnumerable
1 enumerable)\r\n at System.Collections.Generic.List1.InsertRange(Int32 index, IEnumerable
1 collection)\r\n at Microsoft.OData.UriParser.SelectExpandBinder.Bind(ExpandToken tokenIn)\r\n at Microsoft.OData.UriParser.SelectExpandSemanticBinder.Bind(ODataPathInfo odataPathInfo, ExpandToken expandToken, SelectToken selectToken, ODataUriParserConfiguration configuration)\r\n at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpandImplementation(String select, String expand, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)\r\n at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseSelectAndExpand()\r\n at Microsoft.AspNet.OData.Query.Validators.SelectExpandQueryValidator.Validate(SelectExpandQueryOption selectExpandQueryOption, ODataValidationSettings validationSettings)\r\n at Microsoft.AspNet.OData.Query.Validators.ODataQueryValidator.Validate(ODataQueryOptions options, ODataValidationSettings validationSettings)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.ValidateQuery(HttpRequest request, ODataQueryOptions queryOptions)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.<>c__DisplayClass1_0.b__3(ODataQueryContext queryContext)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.ExecuteQuery(Object responseValue, IQueryable singleResultCollection, IWebApiActionDescriptor actionDescriptor, Func2 modelFunction, IWebApiRequestMessage request, Func
2 createQueryOptionFunction)\r\n at Microsoft.AspNet.OData.EnableQueryAttribute.OnActionExecuted(Object responseValue, IQueryable singleResultCollection, IWebApiActionDescriptor actionDescriptor, IWebApiRequestMessage request, Func2 modelFunction, Func
2 createQueryOptionFunction, Action1 createResponseAction, Action
3 createErrorAction)"}}}
My child DataGrid Data is bound to getViewProduktivnostPlocesResult
I think my parameter is wrong, but not shure!
OK! I deleted expand part and got this JSON message (Status 200):
{"@odata.context":"http://localhost:5000/odata/Petroprojekt/$metadata#ViewProduktivnostPloces","value":[{"ID_parametra_naloga":35499,"Stapova":125,"Stapova_uradjeno":77,"Stapova_slomljeno":1,"Upareno":0,"Datum":"2019-01-31T22:39:34.587Z","Ime":"Mladen Eri\u0107"},{"ID_parametra_naloga":35499,"Stapova":0,"Stapova_uradjeno":32,"Stapova_slomljeno":0,"Upareno":0,"Datum":"2019-01-31T22:56:22.863Z","Ime":"Mladen Eri\u0107"},{"ID_parametra_naloga":35499,"Stapova":0,"Stapova_uradjeno":16,"Stapova_slomljeno":1,"Upareno":0,"Datum":"2019-02-01T08:58:20.463Z","Ime":"Mi\u0107o Babi\u0107"},{"ID_parametra_naloga":35499,"Stapova":0,"Stapova_uradjeno":-1,"Stapova_slomljeno":0,"Upareno":0,"Datum":"2019-02-01T08:58:47.4Z","Ime":"Mi\u0107o Babi\u0107"}]}
It seems to be ok but my row is still empty and if I click to sort any of columns in child DataGrid it load all data from query (unfiltered).
Thank you so much for your help!