示例#1
0
        public static VendingMachineContext InstanceFactory(string connectionString)
        {
            if (instance == null)
            {
                instance = new VendingMachineContext();
            }

            instance.connectionString = connectionString;
            return(instance);
        }
示例#2
0
        public static VendingMachineContext InstanceFactory()
        {
            if (instance == null)
            {
                instance = new VendingMachineContext();
            }

            if (String.IsNullOrEmpty(instance.connectionString))
            {
                throw new NullConnectionStringException();
            }

            return(instance);
        }