Skip to content

Instantly share code, notes, and snippets.

@nmcc
Last active March 28, 2017 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmcc/bd8eeec162daf062b350f10ef494fd79 to your computer and use it in GitHub Desktop.
Save nmcc/bd8eeec162daf062b350f10ef494fd79 to your computer and use it in GitHub Desktop.
Singleton .NET Core
public class ImageStore
{
private readonly IDictionary<string, byte[]> imagemMap = new Dictionary<string, byte[]>();
public void AddImage(string name, byte[] imageContent) =>
this.imagemMap.Add(name, imageContent);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment