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

Remove WithCurrentCulture (Resolves #862) #2108

Merged
merged 1 commit into from
May 4, 2015
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,7 @@ public virtual async Task<int> SaveChangesAsync(bool acceptAllChangesOnSuccess,

try
{
var result
= await SaveChangesAsync(entriesToSave, cancellationToken)
.WithCurrentCulture();
var result = await SaveChangesAsync(entriesToSave, cancellationToken);

if (acceptAllChangesOnSuccess)
{
Expand All @@ -334,7 +332,7 @@ var result
protected virtual async Task<int> SaveChangesAsync(
[NotNull] IReadOnlyList<InternalEntityEntry> entriesToSave,
CancellationToken cancellationToken = default(CancellationToken))
=> await _dataStore.SaveChangesAsync(entriesToSave, cancellationToken).WithCurrentCulture();
=> await _dataStore.SaveChangesAsync(entriesToSave, cancellationToken);

public virtual void AcceptAllChanges()
{
Expand Down
2 changes: 1 addition & 1 deletion src/EntityFramework.Core/DbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public virtual Task<int> SaveChangesAsync(CancellationToken cancellationToken =

try
{
return await stateManager.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken).WithCurrentCulture();
return await stateManager.SaveChangesAsync(acceptAllChangesOnSuccess, cancellationToken);
}
catch (Exception ex)
{
Expand Down
1 change: 0 additions & 1 deletion src/EntityFramework.Core/EntityFramework.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@
<Compile Include="Query\SharedQueryExtensions.cs" />
<Compile Include="DbSet`.cs" />
<Compile Include="EntityState.cs" />
<Compile Include="Extensions\EntityFrameworkTaskExtensions.cs" />
<Compile Include="Internal\InternalDbSet.cs" />
<Compile Include="Metadata\Builders\BasicModelBuilder.cs" />
<Compile Include="Metadata\KeyExtensions.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,7 @@ public static void Load<TSource>([NotNull] this IQueryable<TSource> source)

using (var enumerator = asyncEnumerable.GetEnumerator())
{
while (await enumerator.MoveNext().WithCurrentCulture())
while (await enumerator.MoveNext())
{
}
}
Expand Down
229 changes: 0 additions & 229 deletions src/EntityFramework.Core/Extensions/EntityFrameworkTaskExtensions.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public async Task<bool> MoveNext(CancellationToken cancellationToken)
_inner = _exceptionInterceptor._innerFactory().GetEnumerator();
}

return await _inner.MoveNext(cancellationToken).WithCurrentCulture();
return await _inner.MoveNext(cancellationToken);
}
catch (Exception e)
{
Expand Down
6 changes: 2 additions & 4 deletions src/EntityFramework.Core/Query/QueryBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,12 @@ var entityKey
relatedEntitiesLoaders,
ct,
currentNavigationIndex + 1,
queryStateManager)
.WithCurrentCulture();
queryStateManager);

return targetEntity;
})
.Where(e => e != null)
.ToList(cancellationToken)
.WithCurrentCulture());
.ToList(cancellationToken));
}

private IEntityType IncludeCore(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task<bool> MoveNext(CancellationToken cancellationToken)

if (!_moved)
{
await _task.WithCurrentCulture();
await _task;

_moved = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public async Task<bool> MoveNext(CancellationToken cancellationToken)
{
_relatedValuesEnumerable._iterator._hasRemainingRows
= await _relatedValuesEnumerable._iterator._relatedValuesEnumerator
.MoveNext(cancellationToken)
.WithCurrentCulture();
.MoveNext(cancellationToken);

_relatedValuesEnumerable._iterator._moveNextPending = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ public class AsyncQueryMethodProvider : IQueryMethodProvider
{
var result
= await enumerator.Current.IsDBNullAsync(0, cancellationToken)
.WithCurrentCulture()
? default(TResult)
: await enumerator.Current.GetFieldValueAsync<TResult>(0, cancellationToken)
.WithCurrentCulture();
: await enumerator.Current.GetFieldValueAsync<TResult>(0, cancellationToken);

return result;
}
Expand Down
10 changes: 4 additions & 6 deletions src/EntityFramework.Relational/Query/AsyncQueryingEnumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ public async Task<bool> MoveNext(CancellationToken cancellationToken)
var hasNext
= await (_reader == null
? InitializeAndReadAsync(cancellationToken)
: _reader.ReadAsync(cancellationToken))
.WithCurrentCulture();
: _reader.ReadAsync(cancellationToken));

Current = !hasNext ? default(T) : _enumerable._shaper(_reader);

Expand All @@ -72,8 +71,7 @@ var hasNext
private async Task<bool> InitializeAndReadAsync(CancellationToken cancellationToken)
{
await _enumerable._relationalQueryContext.Connection
.OpenAsync(cancellationToken)
.WithCurrentCulture();
.OpenAsync(cancellationToken);

using (var command
= _enumerable._commandBuilder
Expand All @@ -83,12 +81,12 @@ await _enumerable._relationalQueryContext.Connection
{
_enumerable._logger.LogCommand(command);

_reader = await command.ExecuteReaderAsync(cancellationToken).WithCurrentCulture();
_reader = await command.ExecuteReaderAsync(cancellationToken);
}

_enumerable._relationalQueryContext.RegisterDataReader(_reader);

return await _reader.ReadAsync(cancellationToken).WithCurrentCulture();
return await _reader.ReadAsync(cancellationToken);
}

public T Current { get; private set; }
Expand Down
4 changes: 2 additions & 2 deletions src/EntityFramework.Relational/RelationalConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public virtual RelationalTransaction BeginTransaction(IsolationLevel isolationLe
throw new InvalidOperationException(Strings.TransactionAlreadyStarted);
}

await OpenAsync(cancellationToken).WithCurrentCulture();
await OpenAsync(cancellationToken);

return BeginTransactionWithNoPreconditions(isolationLevel);
}
Expand Down Expand Up @@ -180,7 +180,7 @@ public virtual async Task OpenAsync(CancellationToken cancellationToken = defaul
#endif
if (_openedCount == 0)
{
await _connection.Value.OpenAsync(cancellationToken).WithCurrentCulture();
await _connection.Value.OpenAsync(cancellationToken);
}
_openedCount++;
}
Expand Down