C# Language

C# Script

Simple code evaluation

You can evaluate any valid C# code:

int value = await CSharpScript.EvaluateAsync<int>("15 * 89 + 95");
var span = await CSharpScript.EvaluateAsync<TimeSpan>("new DateTime(2016,1,1) - DateTime.Now");

If type is not specified, the result is object:

object value = await CSharpScript.EvaluateAsync("15 * 89 + 95");

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow