Dear support,
How to specify a cast to derived entity dynamically (without setting it at the Url parameter) ?
Currently:
https://localhost:7003/v1/TransCategoryBases(10d2ceb1-f292-49bc-9230-1de352c656b4)
To:
https://localhost:7003/v1/TransCategoryBases(10d2ceb1-f292-49bc-9230-1de352c656b4)/AMI.FinancialTransCategoryModel
Simple Odata Example:
var flights = await client
.For<Person>()
.Key("russellwhyte")
.NavigateTo(x => x.Trips)
.Key(1003)
.NavigateTo(x => x.PlanItems)
.As<Flight>()
.FindEntriesAsync();
Advanced OData Tutorial with Simple.OData.Client · OData - the Best Way to REST
Hi
Vincent,
Greetings from Syncfusion support.
We analyzed your scenario, and we suggest you set the BatchUrl and Url
properties of SFDataManager to achieve your requirement. Please refer to the
below code snippet.
<SfGrid @ref="Grid1" TValue="Vehicle" AllowSorting="true" AllowFiltering="true" AllowPaging="true" Toolbar="@(new List<string>() { "Cancel", "Update" })"> <SfDataManager @ref="dm" Url="/Vehicles?$expand=VehicleMake" BatchUrl="/Vehicles" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager> <GridEditSettings AllowAdding="true" AllowDeleting="true" AllowEditing="true" Mode="EditMode.Batch"></GridEditSettings> <GridColumns> <GridColumn Field="@nameof(Vehicle.VehicleId)" IsPrimaryKey="true" Visible="false"></GridColumn> <GridColumn Field="@nameof(Vehicle.RegistrationNumber)"></GridColumn> <GridColumn Field="VehicleMake.VehicleMakeText"></GridColumn> </GridColumns> </SfGrid> |
Kindly get back to us if you have any further queries.
Dear support,
This workaround is not working, as for expemple, I need to expand a property on the derived object when initializing the grid.
I clearly need a "Cast" functionality so that the data manager only add the cast url block at the end of the default query behaviour.
get:
Actually: https://localhost:7003/v1/TransCategoryBases
Expected: https://localhost:7003/v1/TransCategoryBases/AMI.FinancialTransCategoryModel
patch:
Actually: https://localhost:7003/v1/TransCategoryBases
(10d2ceb1-f292-49bc-9230-1de352c656b4)
Expected: https://localhost:7003/v1/TransCategoryBases(10d2ceb1-f292-49bc-9230-1de352c656b4) /AMI.FinancialTransCategoryModel
and not:
https://localhost:7003/v1/TransCategoryBases/AMI.FinancialTransCategoryModel
(10d2ceb1-f292-49bc-9230-1de352c656b4)
if I cast at the url level like below
<SfDataManager Url="@($"{xxxx}/TransSubCategoryBases/AMI.FinanceTransCategoryModel")" .../>
We have analyzed your query and we suggest you add parameters dynamically by using Add params method. We have discussed this topic in detail in our UG documentation. Kindly refer to the attached document link for your reference.
Reference link: https://blazor.syncfusion.com/documentation/datagrid/data-binding#sending-additional-parameters-to-the-server
This does not work. Duplicate https://support.syncfusion.com/support/tickets/420614
Please close the ticket