Last active
March 21, 2020 06:12
-
-
Save mafshin/430c77a47c9206a81489f6fff6a92600 to your computer and use it in GitHub Desktop.
Singleton C#
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
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