This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
var today = DateTime.Now.ToString(); | |
var message = $"Hello World, This file is created at {today}"; | |
// Some fancy comment here | |
class Foo | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure you define the version of Nuget package for caching! | |
#r "nuget: Newtonsoft.Json, 12.0.3" | |
using System; | |
using Newtonsoft.Json; | |
class Product | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Newtonsoft.Json; | |
class Product | |
{ | |
public Guid Id{get;set;} | |
public string Name{get;set;} | |
public bool Enabled{get;set;} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
LongStringConcatWithStringBuilder(); | |
//LongStringConcat(); | |
var bytes = GC.GetTotalMemory(false); // for getting memory used by GC | |
Console.WriteLine("Bytes consumed: {0}", bytes); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Foo | |
{ | |
private JobQueue _jobQueue; | |
private Guid _uniqeId; | |
public Foo(JobQueue jobQueue) | |
{ | |
_jobQueue = jobQueue; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static WeakReference _weakStringBuilder = | |
new WeakReference(new StringBuilder()); | |
static void Main(string[] args) | |
{ | |
if (_weakStringBuilder.IsAlive) | |
Console.WriteLine("Alive"); | |
GC.Collect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using McMaster.Extensions.CommandLineUtils; | |
using System; | |
using System.IO; | |
namespace CSVUtil | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputFileOption = app.Option<string>("-i|--input", "Input file to convert" | |
, CommandOptionType.SingleValue) | |
.IsRequired(); | |
var verboseOption = app.Option("-v|--verbose", "Display operation details" | |
, CommandOptionType.NoValue); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#region convert-command | |
app.Command("convert", | |
(convert) => | |
{ | |
var outputOption = convert.Option("-o|--output", "Output File" | |
, CommandOptionType.SingleValue); | |
var firstRowOption = convert.Option("-f|--first-row-header", "First row as header" | |
, CommandOptionType.NoValue); |
OlderNewer