在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
比如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 转为C#的代码: 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://www.ttrar.com/html/VBNet-to-C-Sharp-Converter.html#down |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论