Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenkuhn committed Sep 7, 2022
1 parent 30f0f8e commit fac6c87
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/Sknet.OpenIddict.LiteDB/OpenIddictLiteDBContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ public class OpenIddictLiteDBContext : IOpenIddictLiteDBContext
private readonly IOptionsMonitor<OpenIddictLiteDBOptions> _options;
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBContext"/> class.
/// </summary>
public OpenIddictLiteDBContext(
IOptionsMonitor<OpenIddictLiteDBOptions> options,
IServiceProvider provider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class OpenIddictLiteDBApplicationStoreResolver : IOpenIddictApplicationSt
private readonly ConcurrentDictionary<Type, Type> _cache = new ConcurrentDictionary<Type, Type>();
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBApplicationStoreResolver"/> class.
/// </summary>
public OpenIddictLiteDBApplicationStoreResolver(IServiceProvider provider)
=> _provider = provider ?? throw new ArgumentNullException(nameof(provider));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class OpenIddictLiteDBAuthorizationStoreResolver : IOpenIddictAuthorizati
private readonly ConcurrentDictionary<Type, Type> _cache = new ConcurrentDictionary<Type, Type>();
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBAuthorizationStoreResolver"/> class.
/// </summary>
public OpenIddictLiteDBAuthorizationStoreResolver(IServiceProvider provider)
=> _provider = provider ?? throw new ArgumentNullException(nameof(provider));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class OpenIddictLiteDBScopeStoreResolver : IOpenIddictScopeStoreResolver
private readonly ConcurrentDictionary<Type, Type> _cache = new ConcurrentDictionary<Type, Type>();
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBScopeStoreResolver"/> class.
/// </summary>
public OpenIddictLiteDBScopeStoreResolver(IServiceProvider provider)
=> _provider = provider ?? throw new ArgumentNullException(nameof(provider));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class OpenIddictLiteDBTokenStoreResolver : IOpenIddictTokenStoreResolver
private readonly ConcurrentDictionary<Type, Type> _cache = new ConcurrentDictionary<Type, Type>();
private readonly IServiceProvider _provider;

/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBTokenStoreResolver"/> class.
/// </summary>
public OpenIddictLiteDBTokenStoreResolver(IServiceProvider provider)
=> _provider = provider ?? throw new ArgumentNullException(nameof(provider));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace Sknet.OpenIddict.LiteDB;
public class OpenIddictLiteDBApplicationStore<TApplication> : IOpenIddictApplicationStore<TApplication>
where TApplication : OpenIddictLiteDBApplication
{
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBApplicationStore{TApplication}"/> class.
/// </summary>
public OpenIddictLiteDBApplicationStore(
IOpenIddictLiteDBContext context,
IOptionsMonitor<OpenIddictLiteDBOptions> options)
Expand Down Expand Up @@ -150,7 +153,7 @@ async IAsyncEnumerable<TApplication> ExecuteAsync([EnumeratorCancellation] Cance
var collection = database.GetCollection<TApplication>(Options.CurrentValue.ApplicationsCollectionName);

var applications = collection.Query()
.Where(entity => entity.PostLogoutRedirectUris.Contains(address))
.Where(entity => entity.PostLogoutRedirectUris != null && entity.PostLogoutRedirectUris.Contains(address))
.ToEnumerable().ToAsyncEnumerable();

await foreach (var application in applications)
Expand All @@ -177,7 +180,7 @@ async IAsyncEnumerable<TApplication> ExecuteAsync([EnumeratorCancellation] Cance
var collection = database.GetCollection<TApplication>(Options.CurrentValue.ApplicationsCollectionName);

var applications = collection.Query()
.Where(entity => entity.RedirectUris.Contains(address))
.Where(entity => entity.RedirectUris != null && entity.RedirectUris.Contains(address))
.ToEnumerable().ToAsyncEnumerable();

await foreach (var application in applications)
Expand All @@ -188,7 +191,9 @@ async IAsyncEnumerable<TApplication> ExecuteAsync([EnumeratorCancellation] Cance
}

/// <inheritdoc/>
#pragma warning disable CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
public virtual async ValueTask<TResult?> GetAsync<TState, TResult>(
#pragma warning restore CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
Func<IQueryable<TApplication>, TState, IQueryable<TResult>> query,
TState state, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace Sknet.OpenIddict.LiteDB;
public class OpenIddictLiteDBAuthorizationStore<TAuthorization> : IOpenIddictAuthorizationStore<TAuthorization>
where TAuthorization : OpenIddictLiteDBAuthorization
{
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBAuthorizationStore{TAuthorization}"/> class.
/// </summary>
public OpenIddictLiteDBAuthorizationStore(
IOpenIddictLiteDBContext context,
IOptionsMonitor<OpenIddictLiteDBOptions> options)
Expand Down Expand Up @@ -262,7 +265,7 @@ async IAsyncEnumerable<TAuthorization> ExecuteAsync([EnumeratorCancellation] Can
entity.ApplicationId == new ObjectId(client) &&
entity.Status == status &&
entity.Type == type &&
Enumerable.All(scopes, scope => entity.Scopes.Contains(scope)))
Enumerable.All(scopes, scope => entity.Scopes != null && entity.Scopes.Contains(scope)))
.ToEnumerable().ToAsyncEnumerable();

await foreach (var authorization in authorizations)
Expand Down Expand Up @@ -357,7 +360,9 @@ async IAsyncEnumerable<TAuthorization> ExecuteAsync([EnumeratorCancellation] Can
}

/// <inheritdoc/>
#pragma warning disable CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
public virtual async ValueTask<TResult?> GetAsync<TState, TResult>(
#pragma warning restore CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
Func<IQueryable<TAuthorization>, TState, IQueryable<TResult>> query,
TState state, CancellationToken cancellationToken)
{
Expand Down Expand Up @@ -523,7 +528,7 @@ async IAsyncEnumerable<TResult> ExecuteAsync([EnumeratorCancellation] Cancellati
}

/// <inheritdoc/>
public virtual async ValueTask PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)
public virtual ValueTask PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)
{
throw new NotImplementedException();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace Sknet.OpenIddict.LiteDB;
public class OpenIddictLiteDBScopeStore<TScope> : IOpenIddictScopeStore<TScope>
where TScope : OpenIddictLiteDBScope
{
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBScopeStore{TScope}"/> class.
/// </summary>
public OpenIddictLiteDBScopeStore(
IOpenIddictLiteDBContext context,
IOptionsMonitor<OpenIddictLiteDBOptions> options)
Expand Down Expand Up @@ -169,7 +172,7 @@ async IAsyncEnumerable<TScope> ExecuteAsync([EnumeratorCancellation] Cancellatio
var collection = database.GetCollection<TScope>(Options.CurrentValue.ScopesCollectionName);

var scopes = collection.Query()
.Where(entity => entity.Resources.Contains(resource))
.Where(entity => entity.Resources != null && entity.Resources.Contains(resource))
.ToEnumerable().ToAsyncEnumerable();

await foreach (var scope in scopes)
Expand All @@ -180,7 +183,9 @@ async IAsyncEnumerable<TScope> ExecuteAsync([EnumeratorCancellation] Cancellatio
}

/// <inheritdoc/>
#pragma warning disable CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
public virtual async ValueTask<TResult?> GetAsync<TState, TResult>(
#pragma warning restore CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
Func<IQueryable<TScope>, TState, IQueryable<TResult>> query,
TState state, CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace Sknet.OpenIddict.LiteDB;
public class OpenIddictLiteDBTokenStore<TToken> : IOpenIddictTokenStore<TToken>
where TToken : OpenIddictLiteDBToken
{
/// <summary>
/// Creates a new instance of the <see cref="OpenIddictLiteDBTokenStore{TToken}"/> class.
/// </summary>
public OpenIddictLiteDBTokenStore(
IOpenIddictLiteDBContext context,
IOptionsMonitor<OpenIddictLiteDBOptions> options)
Expand Down Expand Up @@ -344,7 +347,9 @@ async IAsyncEnumerable<TToken> ExecuteAsync([EnumeratorCancellation] Cancellatio
}

/// <inheritdoc/>
#pragma warning disable CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
public virtual async ValueTask<TResult?> GetAsync<TState, TResult>(
#pragma warning restore CS8613 // Nullability of reference types in return type doesn't match implicitly implemented member.
Func<IQueryable<TToken>, TState, IQueryable<TResult>> query,
TState state, CancellationToken cancellationToken)
{
Expand Down Expand Up @@ -564,7 +569,7 @@ async IAsyncEnumerable<TResult> ExecuteAsync([EnumeratorCancellation] Cancellati
}

/// <inheritdoc/>
public virtual async ValueTask PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)
public virtual ValueTask PruneAsync(DateTimeOffset threshold, CancellationToken cancellationToken)
{
throw new NotImplementedException();

Expand Down

0 comments on commit fac6c87

Please sign in to comment.