private bool TryGenerateIdFromKeys(IProperty idProperty, out object value)
            {
                var entityEntry = Activator.CreateInstance(_readItemExpression.EntityType.ClrType);

#pragma warning disable EF1001 // Internal EF Core API usage.
                var internalEntityEntry = new InternalEntityEntryFactory().Create(
                    _cosmosQueryContext.Context.GetDependencies().StateManager, _readItemExpression.EntityType, entityEntry);
#pragma warning restore EF1001 // Internal EF Core API usage.

                foreach (var keyProperty in _readItemExpression.EntityType.FindPrimaryKey().Properties)
                {
                    var property = _readItemExpression.EntityType.FindProperty(keyProperty.Name);

                    if (TryGetParameterValue(property, out var parameterValue))
                    {
#pragma warning disable EF1001 // Internal EF Core API usage.
                        internalEntityEntry[property] = parameterValue;
#pragma warning restore EF1001 // Internal EF Core API usage.
                    }
                }

#pragma warning disable EF1001 // Internal EF Core API usage.
                internalEntityEntry.SetEntityState(EntityState.Added);

                value = internalEntityEntry[idProperty];

                internalEntityEntry.SetEntityState(EntityState.Detached);
#pragma warning restore EF1001 // Internal EF Core API usage.

                return(value != null);
            }
                private bool TryGenerateIdFromKeys(IProperty idProperty, out object value)
                {
                    var entityEntry = Activator.CreateInstance(_entityType.ClrType);

#pragma warning disable EF1001
                    var internalEntityEntry = new InternalEntityEntryFactory().Create(_stateManager, _entityType, entityEntry);

                    foreach (var keyProperty in _entityType.FindPrimaryKey().Properties)
                    {
                        var property = _entityType.FindProperty(keyProperty.Name);

                        if (TryGetParameterValue(property, out var parameterValue))
                        {
                            internalEntityEntry[property] = parameterValue;
                        }
                    }

                    internalEntityEntry.SetEntityState(EntityState.Added);

                    value = internalEntityEntry[idProperty];

                    internalEntityEntry.SetEntityState(EntityState.Detached);
#pragma warning restore EF1001

                    return(value != null);
                }