Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[automated] Merge branch 'release/8.0' => 'main' #31738

Merged
merged 6 commits into from
Sep 15, 2023
52 changes: 26 additions & 26 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Extensions.Caching.Memory" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.Caching.Memory" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Json" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.Configuration.Json" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.Configuration" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.Extensions.Logging" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="System.Text.Json" Version="8.0.0-rc.2.23462.12">
<Dependency Name="System.Text.Json" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
<!-- NB: Using BrowserDebugHost to represent the nonshipping version of Microsoft.NETCore.App -->
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="8.0.0-rc.2.23462.12">
<Dependency Name="Microsoft.NETCore.BrowserDebugHost.Transport" Version="8.0.0-rc.2.23464.16">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>0f3d1ed15f64cb9a9d4f47d1a1ed433e0047e16c</Sha>
<Sha>9cdbc87dadbf358206f20f17fed005cdcb253452</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
26 changes: 13 additions & 13 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
<UsingToolXliff>False</UsingToolXliff>
</PropertyGroup>
<PropertyGroup Label="Dependencies from dotnet/runtime">
<MicrosoftExtensionsCachingMemoryVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsConfigurationVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsConfigurationVersion>
<MicrosoftExtensionsConfigurationAbstractionsVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsConfigurationAbstractionsVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
<MicrosoftExtensionsConfigurationJsonVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsConfigurationJsonVersion>
<MicrosoftExtensionsDependencyInjectionVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsDependencyInjectionVersion>
<MicrosoftExtensionsDependencyModelVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftExtensionsHostFactoryResolverSourcesVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
<MicrosoftExtensionsLoggingVersion>8.0.0-rc.2.23462.12</MicrosoftExtensionsLoggingVersion>
<SystemTextJsonVersion>8.0.0-rc.2.23462.12</SystemTextJsonVersion>
<MicrosoftNETCoreAppRefVersion>8.0.0-rc.2.23462.12</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>8.0.0-rc.2.23462.12</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETCoreBrowserDebugHostTransportVersion>8.0.0-rc.2.23462.12</MicrosoftNETCoreBrowserDebugHostTransportVersion>
<MicrosoftExtensionsCachingMemoryVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsConfigurationVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsConfigurationVersion>
<MicrosoftExtensionsConfigurationAbstractionsVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsConfigurationAbstractionsVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsConfigurationEnvironmentVariablesVersion>
<MicrosoftExtensionsConfigurationJsonVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsConfigurationJsonVersion>
<MicrosoftExtensionsDependencyInjectionVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsDependencyInjectionVersion>
<MicrosoftExtensionsDependencyModelVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftExtensionsHostFactoryResolverSourcesVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsHostFactoryResolverSourcesVersion>
<MicrosoftExtensionsLoggingVersion>8.0.0-rc.2.23464.16</MicrosoftExtensionsLoggingVersion>
<SystemTextJsonVersion>8.0.0-rc.2.23464.16</SystemTextJsonVersion>
<MicrosoftNETCoreAppRefVersion>8.0.0-rc.2.23464.16</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>8.0.0-rc.2.23464.16</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETCoreBrowserDebugHostTransportVersion>8.0.0-rc.2.23464.16</MicrosoftNETCoreBrowserDebugHostTransportVersion>
</PropertyGroup>
<PropertyGroup Label="Dependencies from dotnet/arcade">
<MicrosoftDotNetBuildTasksTemplatingVersion>8.0.0-beta.23451.1</MicrosoftDotNetBuildTasksTemplatingVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1791,19 +1791,23 @@ bool TryRewriteEntityEquality([NotNullWhen(true)] out Expression? result)
if (allNonPrincipalSharedNonPkProperties.Count != 0
&& allNonPrincipalSharedNonPkProperties.All(p => p.IsNullable))
{
var atLeastOneNonNullValueInNullablePropertyCondition = allNonPrincipalSharedNonPkProperties
// if we don't have any required properties to properly check the nullability,
// we rely on optional ones (somewhat unreliably)
// - if entity is to be null, all the properties must be null
// - if the entity is to be not null, at least one property must be not null
var optionalPropertiesCondition = allNonPrincipalSharedNonPkProperties
.Select(
p => Infrastructure.ExpressionExtensions.CreateEqualsExpression(
CreatePropertyAccessExpression(nonNullEntityReference, p),
Expression.Constant(null, p.ClrType.MakeNullable()),
nodeType != ExpressionType.Equal))
.Aggregate((l, r) => nodeType == ExpressionType.Equal ? Expression.OrElse(l, r) : Expression.AndAlso(l, r));
.Aggregate((l, r) => nodeType == ExpressionType.Equal ? Expression.AndAlso(l, r) : Expression.OrElse(l, r));

condition = condition == null
? atLeastOneNonNullValueInNullablePropertyCondition
? optionalPropertiesCondition
: nodeType == ExpressionType.Equal
? Expression.OrElse(condition, atLeastOneNonNullValueInNullablePropertyCondition)
: Expression.AndAlso(condition, atLeastOneNonNullValueInNullablePropertyCondition);
? Expression.OrElse(condition, optionalPropertiesCondition)
: Expression.AndAlso(condition, optionalPropertiesCondition);
}

if (condition != null)
Expand Down
29 changes: 29 additions & 0 deletions src/EFCore.SqlServer/DataCompressionType.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

// ReSharper disable once CheckNamespace
namespace Microsoft.EntityFrameworkCore;

/// <summary>
/// Indicates type of data compression used on a index.
/// </summary>
/// <remarks>
/// See <see href="https://docs.microsoft.com/sql/relational-databases/data-compression">Data Compression</see> for more information on data compression.
/// </remarks>
public enum DataCompressionType
{
/// <summary>
/// Index is not compressed.
/// </summary>
None,

/// <summary>
/// Index is compressed by using row compression.
/// </summary>
Row,

/// <summary>
/// Index is compressed by using page compression.
/// </summary>
Page
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ private static readonly MethodInfo IndexHasFillFactorMethodInfo
= typeof(SqlServerIndexBuilderExtensions).GetRuntimeMethod(
nameof(SqlServerIndexBuilderExtensions.HasFillFactor), new[] { typeof(IndexBuilder), typeof(int) })!;

private static readonly MethodInfo IndexIsSortedInTempDbInfo
= typeof(SqlServerIndexBuilderExtensions).GetRuntimeMethod(
nameof(SqlServerIndexBuilderExtensions.IsSortedInTempDb), new[] { typeof(IndexBuilder), typeof(bool) })!;

private static readonly MethodInfo IndexUseDataCompressionInfo
= typeof(SqlServerIndexBuilderExtensions).GetRuntimeMethod(
nameof(SqlServerIndexBuilderExtensions.UseDataCompression), new[] { typeof(IndexBuilder), typeof(DataCompressionType) })!;

private static readonly MethodInfo KeyIsClusteredMethodInfo
= typeof(SqlServerKeyBuilderExtensions).GetRuntimeMethod(
nameof(SqlServerKeyBuilderExtensions.IsClustered), new[] { typeof(KeyBuilder), typeof(bool) })!;
Expand Down Expand Up @@ -341,6 +349,8 @@ protected override bool IsHandledByConvention(IProperty property, IAnnotation an

SqlServerAnnotationNames.Include => new MethodCallCodeFragment(IndexIncludePropertiesMethodInfo, annotation.Value),
SqlServerAnnotationNames.FillFactor => new MethodCallCodeFragment(IndexHasFillFactorMethodInfo, annotation.Value),
SqlServerAnnotationNames.SortedInTempDb => new MethodCallCodeFragment(IndexIsSortedInTempDbInfo, annotation.Value),
SqlServerAnnotationNames.DataCompression => new MethodCallCodeFragment(IndexUseDataCompressionInfo, annotation.Value),

_ => null
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public override void Generate(IIndex index, CSharpRuntimeAnnotationCodeGenerator
annotations.Remove(SqlServerAnnotationNames.CreatedOnline);
annotations.Remove(SqlServerAnnotationNames.Include);
annotations.Remove(SqlServerAnnotationNames.FillFactor);
annotations.Remove(SqlServerAnnotationNames.SortedInTempDb);
annotations.Remove(SqlServerAnnotationNames.DataCompression);
}

base.Generate(index, parameters);
Expand All @@ -119,6 +121,8 @@ public override void Generate(ITableIndex index, CSharpRuntimeAnnotationCodeGene
annotations.Remove(SqlServerAnnotationNames.CreatedOnline);
annotations.Remove(SqlServerAnnotationNames.Include);
annotations.Remove(SqlServerAnnotationNames.FillFactor);
annotations.Remove(SqlServerAnnotationNames.SortedInTempDb);
annotations.Remove(SqlServerAnnotationNames.DataCompression);
}

base.Generate(index, parameters);
Expand Down
Loading