Example #1
0
        // #end example

        // #example: load the state from the database
        private PersistedAutoIncrements EnsureLoadedIncrements()
        {
            if (null == state)
            {
                state = LoadOrCreateState();
            }
            return(state);
        }
Example #2
0
 // #example: getting the next id and storing state
 public int GetNextID(Type forClass)
 {
     lock (dataLock)
     {
         PersistedAutoIncrements incrementState = EnsureLoadedIncrements();
         return(incrementState.NextNumber(forClass));
     }
 }
 private PersistedAutoIncrements EnsureLoadedIncrements(IObjectContainer container)
 {
     return(state ?? (state = LoadOrCreateState(container)));
 }
	    private PersistedAutoIncrements EnsureLoadedIncrements(IObjectContainer container) {
			return state ?? (state = LoadOrCreateState(container));
		}