internal void AddToTempIds(UniqueId uniqueId) { if (uniqueId != null) { TempIds.Add(uniqueId); } }
private void RemoveMappedTempIds(UniqueIdMap idMap) { foreach (UniqueId uniqueId in idMap.Keys) { TempIds.Remove(uniqueId); } }
/// <inheritdoc /> public virtual object GetNextTempId(DataProperty property) { var nextValue = property.DataType.GetNextTempValue(); if (nextValue == null) { throw new Exception("Unable to generate a temporary id for this property: " + property.Name); } TempIds.Add(new UniqueId(property, nextValue)); return(nextValue); }
internal void MarkTempIdAsMapped(EntityAspect aspect, bool isMapped) { var keyProperties = aspect.EntityType.KeyProperties; foreach (var aProperty in keyProperties) { UniqueId aUniqueId = new UniqueId(aProperty, aspect.GetValue(aProperty.Name)); if (isMapped) { TempIds.Remove(aUniqueId); } else { if (KeyGenerator == null) { return; } if (KeyGenerator.IsTempId(aUniqueId)) { TempIds.Add(aUniqueId); } } } }
/// <inheritdoc /> public bool IsTempId(UniqueId uniqueId) { return(TempIds.Contains(uniqueId)); }