Skip to content

Instantly share code, notes, and snippets.

@0x414c49
Created December 19, 2019 11:07
Show Gist options
  • Save 0x414c49/5784ab0cd0e2736b0fd7074130256514 to your computer and use it in GitHub Desktop.
Save 0x414c49/5784ab0cd0e2736b0fd7074130256514 to your computer and use it in GitHub Desktop.
CSharp scripting example with referencing examle
// You need to reference your Assembly dlls file like this
#r "Newtonsoft.Json.dll"
using System;
using Newtonsoft.Json;
class Product
{
public Guid Id{get;set;}
public string Name{get;set;}
public bool Enabled{get;set;}
}
var productObj = new Product {
Id = Guid.NewGuid(),
Name = "FooBar",
Enabled = true
};
Console.WriteLine(JsonConvert.SerializeObject(productObj));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment