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

Change a few 1's to 0's #18387

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Bcl.AsyncInterfaces" Version="1.1.0-preview1.19470.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>6a4153689e79a8e58ee3ed77e04d04a0d9dc2ea6</Sha>
</Dependency>
<Dependency Name="Microsoft.Bcl.HashCode" Version="1.1.0-preview1.19470.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>6a4153689e79a8e58ee3ed77e04d04a0d9dc2ea6</Sha>
</Dependency>
<Dependency Name="Microsoft.CSharp" Version="4.7.0-preview1.19470.8" CoherentParentDependency="Microsoft.NETCore.App.Runtime.win-x64">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>6a4153689e79a8e58ee3ed77e04d04a0d9dc2ea6</Sha>
Expand Down
2 changes: 2 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
<MicrosoftExtensionsLoggingPackageVersion>3.1.0-preview2.19501.2</MicrosoftExtensionsLoggingPackageVersion>
</PropertyGroup>
<PropertyGroup Label="Dependencies from dotnet/corefx">
<MicrosoftBclAsyncInterfacesVersion>1.1.0-preview1.19470.8</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclHashCodeVersion>1.1.0-preview1.19470.8</MicrosoftBclHashCodeVersion>
<MicrosoftCSharpPackageVersion>4.7.0-preview1.19470.8</MicrosoftCSharpPackageVersion>
<SystemCollectionsImmutablePackageVersion>1.7.0-preview1.19470.8</SystemCollectionsImmutablePackageVersion>
<SystemComponentModelAnnotationsPackageVersion>4.7.0-preview1.19470.8</SystemComponentModelAnnotationsPackageVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Abstractions/EFCore.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Provides abstractions and attributes that are used to configure Entity Framework Core</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Microsoft.EntityFrameworkCore.Abstractions</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Cosmos/EFCore.Cosmos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Azure Cosmos provider for Entity Framework Core.</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Microsoft.EntityFrameworkCore.Cosmos</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore.Cosmos</RootNamespace>
Expand Down
37 changes: 25 additions & 12 deletions src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using Microsoft.Azure.Cosmos;
using Microsoft.EntityFrameworkCore.Cosmos.Diagnostics.Internal;
using Microsoft.EntityFrameworkCore.Cosmos.Infrastructure.Internal;
using Microsoft.EntityFrameworkCore.Cosmos.Internal;
using Microsoft.EntityFrameworkCore.Diagnostics;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
Expand Down Expand Up @@ -288,21 +287,35 @@ private async Task<bool> CreateItemOnceAsync(
(string ContainerId, JToken Document, string PartitionKey) parameters,
CancellationToken cancellationToken = default)
{
await using (var stream = new MemoryStream())
await using (var writer = new StreamWriter(stream, new UTF8Encoding(), bufferSize: 1024, leaveOpen: false))
using (var jsonWriter = new JsonTextWriter(writer))
var stream = new MemoryStream();
try
{
JsonSerializer.Create().Serialize(jsonWriter, parameters.Document);
await jsonWriter.FlushAsync(cancellationToken);
var writer = new StreamWriter(stream, new UTF8Encoding(), bufferSize: 1024, leaveOpen: false);
try
{
using (var jsonWriter = new JsonTextWriter(writer))
{
JsonSerializer.Create().Serialize(jsonWriter, parameters.Document);
await jsonWriter.FlushAsync(cancellationToken);

var container = Client.GetDatabase(_databaseId).GetContainer(parameters.ContainerId);
var partitionKey = CreatePartitionKey(parameters.PartitionKey);
using (var response = await container.CreateItemStreamAsync(stream, partitionKey, null, cancellationToken))
var container = Client.GetDatabase(_databaseId).GetContainer(parameters.ContainerId);
var partitionKey = CreatePartitionKey(parameters.PartitionKey);
using (var response = await container.CreateItemStreamAsync(stream, partitionKey, null, cancellationToken))
{
response.EnsureSuccessStatusCode();
return response.StatusCode == HttpStatusCode.Created;
}
}
}
finally
{
response.EnsureSuccessStatusCode();
return response.StatusCode == HttpStatusCode.Created;
await writer.DisposeAsyncIfAvailable();
}
}
finally
{
await stream.DisposeAsyncIfAvailable();
}
}

/// <summary>
Expand Down Expand Up @@ -691,7 +704,7 @@ public async ValueTask DisposeAsync()
_jsonReader = null;
await _reader.DisposeAsyncIfAvailable();
_reader = null;
await _responseStream.DisposeAsync();
await _responseStream.DisposeAsyncIfAvailable();
_responseStream = null;
await _responseMessage.DisposeAsyncIfAvailable();
_responseMessage = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected override bool ShouldRetryOn(Exception exception)

static bool IsTransient(HttpStatusCode statusCode)
=> statusCode == HttpStatusCode.ServiceUnavailable
|| statusCode == HttpStatusCode.TooManyRequests;
|| statusCode == (HttpStatusCode)429; // TooManyRequests
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Design/Design/Internal/CSharpHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public virtual string Lambda(IReadOnlyList<string> properties)
else
{
builder.Append("new { ");
builder.AppendJoin(", ", properties.Select(p => "x." + p));
builder.Append(string.Join(", ", properties.Select(p => "x." + p)));
builder.Append(" }");
}

Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Design/EFCore.Design.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Shared design-time components for Entity Framework Core tools.</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.EntityFrameworkCore.Design</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ protected virtual void GenerateEntityType(
// ReSharper disable once InlineOutVariableDeclaration
var counter = 1;
if (builderName.Length > 1
&& int.TryParse(builderName[1..], out counter))
&& int.TryParse(builderName.Substring(1), out counter))
{
counter++;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ public override string ToString()

private static string StripAttribute([NotNull] string attributeName)
=> attributeName.EndsWith("Attribute", StringComparison.Ordinal)
? attributeName[..^9]
? attributeName.Substring(0, attributeName.Length - 9)
: attributeName;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ private static string StripId(string commonPrefix)
{
return commonPrefix.Length > 2
&& commonPrefix.EndsWith("id", StringComparison.OrdinalIgnoreCase)
? commonPrefix[..^2]
? commonPrefix.Substring(0, commonPrefix.Length - 2)
: commonPrefix;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.InMemory/EFCore.InMemory.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>In-memory database provider for Entity Framework Core (to be used for testing purposes).</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Microsoft.EntityFrameworkCore.InMemory</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore.InMemory</RootNamespace>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Proxies/EFCore.Proxies.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Lazy-loading proxies for EF Core.</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Microsoft.EntityFrameworkCore.Proxies</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Relational/Diagnostics/DbConnectionInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public virtual InterceptionResult ConnectionClosing(
=> result;

/// <summary>
/// Called just before EF intends to call <see cref="DbConnection.CloseAsync()" /> in an async context.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbConnection.CloseAsync" /> in an async context.
/// </summary>
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about the connection. </param>
Expand Down Expand Up @@ -147,7 +147,7 @@ public virtual void ConnectionClosed(
}

/// <summary>
/// Called just after EF has called <see cref="DbConnection.CloseAsync()" />.
/// Called just after EF has called <see cref="M:System.Data.Common.DbConnection.CloseAsync" />.
/// </summary>
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about the connection. </param>
Expand Down
14 changes: 7 additions & 7 deletions src/EFCore.Relational/Diagnostics/DbTransactionInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public virtual DbTransaction TransactionStarted(
=> result;

/// <summary>
/// Called just before EF intends to call <see cref="DbConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand All @@ -92,7 +92,7 @@ public virtual Task<InterceptionResult<DbTransaction>> TransactionStartingAsync(

/// <summary>
/// <para>
/// Called immediately after EF calls <see cref="DbConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)" />.
/// Called immediately after EF calls <see cref="M:System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)" />.
/// </para>
/// <para>
/// This method is still called if an interceptor suppressed creation in <see cref="IDbTransactionInterceptor.TransactionStarting" />.
Expand All @@ -102,7 +102,7 @@ public virtual Task<InterceptionResult<DbTransaction>> TransactionStartingAsync(
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
/// <param name="result">
/// The result of the call to <see cref="DbConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)" />.
/// The result of the call to <see cref="M:System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)" />.
/// This value is typically used as the return value for the implementation of this method.
/// </param>
/// <param name="cancellationToken"> The cancellation token. </param>
Expand Down Expand Up @@ -198,7 +198,7 @@ public virtual void TransactionCommitted(
}

/// <summary>
/// Called just before EF intends to call <see cref="DbTransaction.CommitAsync" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbTransaction.CommitAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand All @@ -224,7 +224,7 @@ public virtual Task<InterceptionResult> TransactionCommittingAsync(
=> Task.FromResult(result);

/// <summary>
/// Called immediately after EF calls <see cref="DbTransaction.CommitAsync" />.
/// Called immediately after EF calls <see cref="M:System.Data.Common.DbTransaction.CommitAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand Down Expand Up @@ -272,7 +272,7 @@ public virtual void TransactionRolledBack(
}

/// <summary>
/// Called just before EF intends to call <see cref="DbTransaction.RollbackAsync" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbTransaction.RollbackAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand All @@ -298,7 +298,7 @@ public virtual Task<InterceptionResult> TransactionRollingBackAsync(
=> Task.FromResult(result);

/// <summary>
/// Called immediately after EF calls <see cref="DbTransaction.RollbackAsync" />.
/// Called immediately after EF calls <see cref="M:System.Data.Common.DbTransaction.RollbackAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand Down
4 changes: 2 additions & 2 deletions src/EFCore.Relational/Diagnostics/IDbConnectionInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Task ConnectionOpenedAsync(
CancellationToken cancellationToken = default);

/// <summary>
/// Called just before EF intends to call <see cref="DbConnection.CloseAsync()" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbConnection.CloseAsync" />.
/// </summary>
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about the connection. </param>
Expand Down Expand Up @@ -156,7 +156,7 @@ void ConnectionClosed(
[NotNull] ConnectionEndEventData eventData);

/// <summary>
/// Called just after EF has called <see cref="DbConnection.CloseAsync()" />.
/// Called just after EF has called <see cref="M:System.Data.Common.DbConnection.CloseAsync" />.
/// </summary>
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about the connection. </param>
Expand Down
14 changes: 7 additions & 7 deletions src/EFCore.Relational/Diagnostics/IDbTransactionInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ DbTransaction TransactionStarted(
[CanBeNull] DbTransaction result);

/// <summary>
/// Called just before EF intends to call <see cref="DbConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand All @@ -107,7 +107,7 @@ Task<InterceptionResult<DbTransaction>> TransactionStartingAsync(

/// <summary>
/// <para>
/// Called immediately after EF calls <see cref="DbConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)" />.
/// Called immediately after EF calls <see cref="M:System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)" />.
/// </para>
/// <para>
/// This method is still called if an interceptor suppressed creation in <see cref="TransactionStarting" />.
Expand All @@ -117,7 +117,7 @@ Task<InterceptionResult<DbTransaction>> TransactionStartingAsync(
/// <param name="connection"> The connection. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
/// <param name="result">
/// The result of the call to <see cref="DbConnection.BeginTransactionAsync(IsolationLevel, CancellationToken)" />.
/// The result of the call to <see cref="M:System.Data.Common.DbConnection.BeginTransactionAsync(System.Data.IsolationLevel,System.Threading.CancellationToken)" />.
/// This value is typically used as the return value for the implementation of this method.
/// </param>
/// <param name="cancellationToken"> The cancellation token. </param>
Expand Down Expand Up @@ -210,7 +210,7 @@ void TransactionCommitted(
[NotNull] TransactionEndEventData eventData);

/// <summary>
/// Called just before EF intends to call <see cref="DbTransaction.CommitAsync" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbTransaction.CommitAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand All @@ -235,7 +235,7 @@ Task<InterceptionResult> TransactionCommittingAsync(
CancellationToken cancellationToken = default);

/// <summary>
/// Called immediately after EF calls <see cref="DbTransaction.CommitAsync" />.
/// Called immediately after EF calls <see cref="M:System.Data.Common.DbTransaction.CommitAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand Down Expand Up @@ -279,7 +279,7 @@ void TransactionRolledBack(
[NotNull] TransactionEndEventData eventData);

/// <summary>
/// Called just before EF intends to call <see cref="DbTransaction.RollbackAsync" />.
/// Called just before EF intends to call <see cref="M:System.Data.Common.DbTransaction.RollbackAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand All @@ -304,7 +304,7 @@ Task<InterceptionResult> TransactionRollingBackAsync(
CancellationToken cancellationToken = default);

/// <summary>
/// Called immediately after EF calls <see cref="DbTransaction.RollbackAsync" />.
/// Called immediately after EF calls <see cref="M:System.Data.Common.DbTransaction.RollbackAsync(System.Threading.CancellationToken)" />.
/// </summary>
/// <param name="transaction"> The transaction. </param>
/// <param name="eventData"> Contextual information about connection and transaction. </param>
Expand Down
2 changes: 1 addition & 1 deletion src/EFCore.Relational/EFCore.Relational.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Shared Entity Framework Core components for relational database providers.</Description>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<MinClientVersion>3.6</MinClientVersion>
<AssemblyName>Microsoft.EntityFrameworkCore.Relational</AssemblyName>
<RootNamespace>Microsoft.EntityFrameworkCore</RootNamespace>
Expand Down
Loading