public HttpResponseMessage Put(DelegateTable delegatestable) { try { using (var ctx = new ShowContext()) { var delegatedata = ctx.delegates.FirstOrDefault(s => s.Barcode__c == delegatestable.Barcode__c); if (delegatedata != null) { if (delegatestable.Salutation__c!=null) { delegatedata.Salutation__c = delegatestable.Salutation__c; } if (delegatestable.First_Name__c != null) { delegatedata.First_Name__c = delegatestable.First_Name__c; } if (delegatestable.Last_Name__c != null) { delegatedata.Last_Name__c = delegatestable.Last_Name__c; } if (delegatestable.Account_Name__c != null) { delegatedata.Account_Name__c = delegatestable.Account_Name__c; } if (delegatestable.Contact_Email__c != null) { delegatedata.Contact_Email__c = delegatestable.Contact_Email__c; } if (delegatestable.Category__c != null) { delegatedata.Category__c = delegatestable.Category__c; } if (delegatestable.Conference_Type__c != null) { delegatedata.Conference_Type__c = delegatestable.Conference_Type__c; } if (delegatestable.Conference_Selection__c != null) { delegatedata.Conference_Selection__c = delegatestable.Conference_Selection__c; } if (delegatestable.Payment_Status_Interface__c != null) { delegatedata.Payment_Status_Interface__c = delegatestable.Payment_Status_Interface__c; } // delegatedata.Barcode__c = delegatestable.Barcode__c; ctx.SaveChanges(); return Request.CreateResponse(HttpStatusCode.OK, "Record updated"); } else { return Request.CreateResponse(HttpStatusCode.NoContent, delegatedata); } } } catch (Exception ex) { return Request.CreateResponse(HttpStatusCode.BadGateway, ex); } }
How to multiple update data using put method web api. I have used single update but i am unable to write code for multiple update. I am using json for updating data through postman application. Single update is working through it properly but i dont know how to multiple update. Please help
What Microsoft Dynamics product/application are you using?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156