DatabaseModule.Static.cs 573 B

12345678910111213141516171819202122232425
  1. using System;
  2. namespace XGame.Framework.Database
  3. {
  4. public partial class DatabaseModule
  5. {
  6. private static DatabaseModule _instance;
  7. public static IDatabaseModule Instance
  8. {
  9. get
  10. {
  11. if(_instance == null)
  12. {
  13. _instance = new DatabaseModule();
  14. }
  15. return _instance;
  16. }
  17. }
  18. public static void Dispose()
  19. {
  20. (_instance as IDisposable)?.Dispose();
  21. _instance = null;
  22. }
  23. }
  24. }