Dear All,
Please find the below code to find the
unique value between 2 JSON Array
JSONOriginalValues -->
(1,2,3,4,5,6) à Array [6] à Original Values
JSONCompareValues --> (1,2,3,7,8) à Array
[5] à Value to Compare
TO be deleted --> 7,8
TO be Updated --> 1,2,3
TO be created --> 4,5,6
var tobeUpdated =
JSONCompareValues.Where(MembersObj => JSONOriginalValues.Any(partyList =>
MembersObj.ContactId["fieldname"].ToString().ToLower() ==
partyList.PartiesContact.ClePartie.ToLower()));
var tobeDeleted =
JSONCompareValues.Where(MembersObj => !JSONOriginalValues.Any(partyList
=> MembersObj.ContactId["fieldname"].ToString().ToLower() ==
partyList.PartiesContact.ClePartie.ToLower()));
var tobeDeleteds =
JSONCompareValues.Where(MembersObj => JSONOriginalValues.All(partyList =>
MembersObj.ContactId["fieldname"].ToString().ToLower() !=
partyList.PartiesContact.ClePartie.ToLower()));
No comments:
Post a Comment