For example, vb.net code:
For each prop in entity. Details.Properties.All (). OfType (of Microsoft.LightSwitch.Details.IEntityStorageProperty) () "Id" Then If not Object.Equals (prop. Value, Prop. OriginalValue )then + = String.Format ("{0}{1}: {2}", VbCrLf, prop. Name, Prop. OriginalValue) + = String.Format ("{0}{1}: {2}", VbCrLf, prop. Name, Prop. Value) End If End If Next
Code to C #:
foreach(varPropinchEntity. 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); } }}
Code conversion Tool Links: Http://www.ttrar.com/html/VBNet-to-C-Sharp-Converter.html#down
Vb. NET to C # code tools