/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public virtual InMemoryIntegerValueGenerator <TProperty> GetIntegerValueGenerator <TProperty>(IProperty property) { if (_integerGenerators == null) { _integerGenerators = new Dictionary <int, IInMemoryIntegerValueGenerator>(); } var propertyIndex = property.GetIndex(); if (!_integerGenerators.TryGetValue(propertyIndex, out var generator)) { generator = new InMemoryIntegerValueGenerator <TProperty>(propertyIndex); _integerGenerators[propertyIndex] = generator; foreach (var row in _rows.Values) { generator.Bump(row); } } return((InMemoryIntegerValueGenerator <TProperty>)generator); }
/// <summary> /// This is an internal API that supports the Entity Framework Core infrastructure and not subject to /// the same compatibility standards as public APIs. It may be changed or removed without notice in /// any release. You should only use it directly in your code with extreme caution and knowing that /// doing so can result in application failures when updating to a new Entity Framework Core release. /// </summary> public virtual InMemoryIntegerValueGenerator <TProperty> GetIntegerValueGenerator <TProperty>(IProperty property) { if (_integerGenerators == null) { _integerGenerators = new Dictionary <int, IInMemoryIntegerValueGenerator>(); } // WARNING: The in-memory provider is using EF internal code here. This should not be copied by other providers. See #15096 var propertyIndex = EntityFrameworkCore.Metadata.Internal.PropertyBaseExtensions.GetIndex(property); if (!_integerGenerators.TryGetValue(propertyIndex, out var generator)) { generator = new InMemoryIntegerValueGenerator <TProperty>(propertyIndex); _integerGenerators[propertyIndex] = generator; foreach (var row in _rows.Values) { generator.Bump(row); } } return((InMemoryIntegerValueGenerator <TProperty>)generator); }