using Microsoft.CodeAnalysis.CSharp.Scripting; var result = await CSharpScript.EvaluateAsync("1 + 2 * 3 / 4"); Console.WriteLine(result);
using Microsoft.CodeAnalysis.CSharp.Scripting; var obj = await CSharpScript.EvaluateAsyncIn this example, we create a dynamic object with properties Name and Age and set their values. We then output the Name property, which should be "John". Package library: Microsoft.CodeAnalysis.CSharp.Scripting("new { Name = \"John\", Age = 30 }"); Console.WriteLine(obj.Name);