Skip to content

Instantly share code, notes, and snippets.

@mafshin
Last active March 21, 2020 06:12
Show Gist options
  • Save mafshin/430c77a47c9206a81489f6fff6a92600 to your computer and use it in GitHub Desktop.
Save mafshin/430c77a47c9206a81489f6fff6a92600 to your computer and use it in GitHub Desktop.
Singleton C#
namespace DataLib
{
public class DataManager
{
public void Run()
{
DataProvider.Instance.RunQuery();
}
}
public class DataProvider
{
private DataProvider()
{
}
static DataProvider()
{
Instance = new DataProvider();
}
public void RunQuery()
{
}
public static DataProvider Instance { get; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment