如何找到两个列表之间的变化? [英] how to find changes between two lists?

查看:77
本文介绍了如何找到两个列表之间的变化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个列表......数据库中的第一个列表(olddata)和浏览器中的第二个列表(newdata)..我需要比较两个列表并将更改保存到数据库中..如何可能?

thankyou ........

解决方案

您可以使用LINQ关键字EXCEPT



  var  differences = list1.Except(list2); 





请参见此处 [< a href =https://msdn.microsoft.com/library/bb908822(v=vs.90).aspx\"target =_ blanktitle =New Window> ^ ]了解更多信息。


i have two lists...the first list from database(olddata) and the second list from browser(newdata)..i need to compare that the two lists and save changes into the database..how it is possible?
thankyou........

解决方案

You can use LINQ keyword EXCEPT for that

var differences = list1.Except(list2);



See here[^] for more information.


这篇关于如何找到两个列表之间的变化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆