v18.3.48 ODataV4 Patch request send all the properties instead of modified properties is fixed., Problem with validations in server api

Hi,

I have to consume an api that performs the model validations on the server, with this new feature, not all the properties are sent to the server and the validations are not fulfilled. Is there some way for send all properties or select list properties from model for sent in the patch call

thanks in advance

7 Replies 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team November 19, 2020 02:37 PM UTC

Hi Sergio, 

Greetings from Syncfusion. 

Query: Is there some way for send all properties or select list properties from model  

We have validated your query and we suggest you to achieve your requirement by using below way. We suggest you to change the UpdateType of ODataV4 Request to Put from Patch request to achieve your requirement. You can get all the properties in changed properties. Find the below code snippets for your reference. 

 
<SfGrid @ref="Grid" TValue="Order" AllowPaging="true" AllowFiltering="true" Toolbar="@(new List<string>() { "Add", "Edit", "Update", "Cancel" })" > 
    <GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Menu"></GridFilterSettings> 
    <GridEditSettings AllowEditing="true" Mode="EditMode.Normal"></GridEditSettings> 
    <SfDataManager @ref="dm" Url="http://localhost:64956/odata/books" Adaptor="Adaptors.ODataV4Adaptor"></SfDataManager> 
    <GridColumns> 
        . . . 
   </GridColumns> 
</SfGrid> 
 
@code{ 
    public SfDataManager dm { get; set; } 
    SfGrid<Order> Grid; 
    . . . 
   protected override void OnAfterRender(bool firstRender) 
    { 
        base.OnAfterRender(firstRender); 
 
        (dm.DataAdaptor as ODataV4Adaptor).Options.UpdateType = HttpMethod.Put; 
    } 
 
 
} 


Also, we have considered this requirement as an usability improvement feature and logged the improvement report for the same. Thank you for taking the time to request this improvement “Need to provide support for adaptor option” and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the improvement feature in any of our upcoming release. Until then we appreciate your patience.  
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.      
  

Please let us know if you have any concerns. 

Regards, 
Rahul 


Marked as answer

SC Sergio Cabello November 19, 2020 05:41 PM UTC

solved with your solution.

thanks for your time


RN Rahul Narayanasamy Syncfusion Team November 20, 2020 04:55 AM UTC

Hi Sergio, 

Thanks for the update. 

We are happy to hear that the provided solution was helpful to achieve your requirement. 

Please get back to us if you need further assistance. 

Regards, 
Rahul  



SC Sergio Cabello replied to Rahul Narayanasamy July 8, 2021 10:52 AM UTC

Hi, 


after upgrade components to last version (19,2,46), the previous solution

(dm.DataAdaptor as ODataV4Adaptor).Options.UpdateType = HttpMethod.Put; 

i have a compile error the UpdateType is now readonly,how can do it now this ?


thanks.



RN Rahul Narayanasamy Syncfusion Team July 9, 2021 06:59 AM UTC

Hi Sergio, 

Query: after upgrade components to last version (19,2,46), the previous solution (dm.DataAdaptor as ODataV4Adaptor).Options.UpdateType = HttpMethod.Put; i have a compile error the UpdateType is now readonly,how can do it now this ? 

In our latest Volume 2 release(19.2.0.44) we did equality comparison support in RemoteOptions struct to meet coding standard. So this error occurred when tried to directly modify the property of the RemoteOptions struct. Struct properties should be changed by assigning new struct instance.   


So to overcome this scenario, we suggest you to modify the struct by assigning it to a local variable, modify the variable, then assign the variable back to the item in the collection. Please refer and modify as like below highlighted codes in your application. 

protected override void OnAfterRender(bool firstRender) 
{ 
    base.OnAfterRender(firstRender); 
    if (dm != null) 
    { 
        RemoteOptions Rm = (dm.DataAdaptor as ODataV4Adaptor).Options; 
        Rm.UpdateType = HttpMethod.Put; 
        (dm.DataAdaptor as ODataV4Adaptor).Options = Rm; 
    } 
} 

Please get back to us if you need further assistance. 

Regards, 
Rahul 



SC Sergio Cabello replied to Rahul Narayanasamy July 9, 2021 08:18 AM UTC

hi Raul 

thanks for the support all is correct now.


best regards.







RN Rahul Narayanasamy Syncfusion Team July 12, 2021 03:50 AM UTC

Hi Sergio, 
 
Thanks for the update. 
 
We are happy to hear that the provided solution was helpful to resolve the reported problem. Please get back to us if you need further assistance. 
 
Regards, 
Rahul 


Loader.
Up arrow icon