Azavea.Open.DAO.Memory.MemoryDaLayer.GetNextAutoGeneratedId C# (CSharp) Method

GetNextAutoGeneratedId() private method

Finds the next generated id number for a column (for inserts for example).
private GetNextAutoGeneratedId ( ClassMapping mapping, string idCol ) : object
mapping ClassMapping The class mapping for the table being queried.
idCol string The ID column for which to generate an ID.
return object
        private object GetNextAutoGeneratedId(ClassMapping mapping, string idCol)
        {
            int retVal = 1;
            string key = mapping.Table + "." + idCol;
            lock (_lastAutogenIds)
            {
                if (_lastAutogenIds.ContainsKey(key))
                {
                    retVal = _lastAutogenIds[key] + 1;
                }
                _lastAutogenIds[key] = retVal;
            }
            return retVal;
        }