C# Related Snippets

 |  codeSnippets

Convert object to JSON in VS Package Manager Window

Newtonsoft.Json.JsonConvert.SerializeObject(theObject, Newtonsoft.Json.Formatting.Indented),nq

Default GUID string

00000000-0000-0000-0000-000000000000

Human readable GUID strings for unit tests

00000000-0000-0000-0000-000000000b0b (Bob)
00000000-0000-0000-0000-0000000ff1ce (Office)
00000000-0000-0000-0000-00000000f00d (Food)
00000000-0000-0000-0000-000000c0ffee (Coffee)
00000000-0000-0000-0000-000000000bad (Bad)

100 character comment line

// ----------------------------------------------------------------------------------------------------

Make internals visible to another assembly / unit test project

Add the following code to the file “Properties/StaticAssemblyInfo.cs”

using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Other.Project.Name")]