For example, vb.net code:
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
Code to 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);}}}
Code conversion Tool Links: Http://www.ttrar.com/html/VBNet-to-C-Sharp-Converter.html#down
Vb. NET to C # code tools