标签:
比如VB.NET的代码:
For Each prop In entity.Details.Properties.All(). OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)() If prop.Name <> "Id" Then If Not Object.Equals(prop.Value, prop.OriginalValue) Then oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.OriginalValue) newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value) End If End If Next
foreach (var prop in entity.Details.Properties.All().OfType<Microsoft.LightSwitch.Details.IEntityStorageProperty>()) { if (prop.Name != "Id") { if (!object.Equals(prop.Value, prop.OriginalValue)) { oldvals += string.Format("{0}{1}: {2}", "\r\n", prop.Name, prop.OriginalValue); newvals += string.Format("{0}{1}: {2}", "\r\n", prop.Name, prop.Value); } } }
标签:
原文地址:http://blog.csdn.net/chinacsharper/article/details/42753245