Two methods for creating an instance as a singleton. Is there a problem with one or other of them such that it should not be used?

前端 未结 0 1098
礼貌的吻别
礼貌的吻别 2020-12-21 00:45

I have two options and both seem to work now:

    static DataManager _db;

    public static DataManager DB
    {
        get
        {
            if (_db ==         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题