-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
92 changed files
with
1,329 additions
and
2,372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
next-version: 1.0.0-dev | ||
next-version: 2.0.0-dev | ||
|
||
branches: | ||
develop: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
namespace InfoCarrier.Core | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
internal class AsyncEnumerableAdapter<T> : IAsyncEnumerable<T> | ||
{ | ||
private readonly Func<IAsyncEnumerator<T>> enumeratorFactory; | ||
|
||
public AsyncEnumerableAdapter(Task<IEnumerable<T>> asyncResult) | ||
{ | ||
this.enumeratorFactory = | ||
() => new AsyncEnumerator(asyncResult); | ||
} | ||
|
||
public IAsyncEnumerator<T> GetEnumerator() => this.enumeratorFactory(); | ||
|
||
private class AsyncEnumerator : IAsyncEnumerator<T> | ||
{ | ||
private readonly Task<IEnumerable<T>> asyncResult; | ||
private IEnumerator<T> enumerator; | ||
|
||
public AsyncEnumerator(Task<IEnumerable<T>> asyncResult) | ||
{ | ||
this.asyncResult = asyncResult; | ||
} | ||
|
||
public T Current => | ||
this.enumerator == null | ||
? default(T) | ||
: this.enumerator.Current; | ||
|
||
public void Dispose() | ||
{ | ||
this.enumerator?.Dispose(); | ||
} | ||
|
||
public async Task<bool> MoveNext(CancellationToken cancellationToken) | ||
{ | ||
if (this.enumerator == null) | ||
{ | ||
this.enumerator = (await this.asyncResult).GetEnumerator(); | ||
} | ||
|
||
return this.enumerator.MoveNext(); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
src/InfoCarrier.Core/Client/Extensions/InfoCarrierServiceCollectionExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace InfoCarrier.Core.Client | ||
{ | ||
using Infrastructure.Internal; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Query; | ||
using Microsoft.EntityFrameworkCore.Query.ExpressionVisitors; | ||
using Microsoft.EntityFrameworkCore.Query.ExpressionVisitors.Internal; | ||
using Microsoft.EntityFrameworkCore.Query.Internal; | ||
using Microsoft.EntityFrameworkCore.Storage; | ||
using Microsoft.EntityFrameworkCore.ValueGeneration; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Query.ExpressionVisitors.Internal; | ||
using Query.Internal; | ||
using Storage.Internal; | ||
|
||
public static class InfoCarrierServiceCollectionExtensions | ||
{ | ||
public static IServiceCollection AddEntityFrameworkInfoCarrierBackend(this IServiceCollection serviceCollection) | ||
{ | ||
var builder = new EntityFrameworkServicesBuilder(serviceCollection) | ||
.TryAdd<IQueryCompiler, InfoCarrierQueryCompiler>() | ||
.TryAdd<IDatabaseProvider, DatabaseProvider<InfoCarrierOptionsExtension>>() | ||
.TryAdd<IValueGeneratorSelector, RelationalValueGeneratorSelector>() | ||
.TryAdd<IDatabase>(p => p.GetService<IInfoCarrierDatabase>()) | ||
.TryAdd<IDbContextTransactionManager, InfoCarrierTransactionManager>() | ||
.TryAdd<IDatabaseCreator, InfoCarrierDatabaseCreator>() | ||
.TryAdd<IQueryContextFactory, InfoCarrierQueryContextFactory>() | ||
.TryAdd<IEntityQueryModelVisitorFactory, InfoCarrierQueryModelVisitorFactory>() | ||
.TryAdd<IEntityQueryableExpressionVisitorFactory, InfoCarrierEntityQueryableExpressionVisitorFactory>() | ||
.TryAddProviderSpecificServices(b => b | ||
.TryAddScoped<IInfoCarrierDatabase, InfoCarrierDatabase>() | ||
.TryAddScoped<IMaterializerFactory, MaterializerFactory>()); | ||
|
||
builder.TryAddCoreServices(); | ||
|
||
return serviceCollection; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
src/InfoCarrier.Core/Client/InfoCarrierServiceCollectionExtensions.cs
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/InfoCarrier.Core/Client/Infrastructure/Internal/InfoCarrierModelSource.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.