Browse Source

Backport the Entity Framework/Entity Framework Core stores changes to OpenIddict 1.x

pull/670/head
Kévin Chalet 9 years ago
parent
commit
1f744d05ad
  1. 19
      src/OpenIddict.EntityFramework/Stores/OpenIddictApplicationStore.cs
  2. 19
      src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs
  3. 19
      src/OpenIddict.EntityFramework/Stores/OpenIddictScopeStore.cs
  4. 19
      src/OpenIddict.EntityFramework/Stores/OpenIddictTokenStore.cs
  5. 26
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs
  6. 26
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs
  7. 26
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs
  8. 26
      src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs

19
src/OpenIddict.EntityFramework/Stores/OpenIddictApplicationStore.cs

@ -17,6 +17,7 @@ using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -33,8 +34,11 @@ namespace OpenIddict.EntityFramework
OpenIddictToken, TContext, string>
where TContext : DbContext
{
public OpenIddictApplicationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictApplicationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
: base(cache, context, options)
{
}
}
@ -54,10 +58,14 @@ namespace OpenIddict.EntityFramework
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictApplicationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictApplicationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -70,6 +78,11 @@ namespace OpenIddict.EntityFramework
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TApplication"/> entity.
/// </summary>

19
src/OpenIddict.EntityFramework/Stores/OpenIddictAuthorizationStore.cs

@ -17,6 +17,7 @@ using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -33,8 +34,11 @@ namespace OpenIddict.EntityFramework
OpenIddictToken, TContext, string>
where TContext : DbContext
{
public OpenIddictAuthorizationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictAuthorizationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
: base(cache, context, options)
{
}
}
@ -54,10 +58,14 @@ namespace OpenIddict.EntityFramework
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictAuthorizationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictAuthorizationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -70,6 +78,11 @@ namespace OpenIddict.EntityFramework
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TApplication"/> entity.
/// </summary>

19
src/OpenIddict.EntityFramework/Stores/OpenIddictScopeStore.cs

@ -15,6 +15,7 @@ using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -29,8 +30,11 @@ namespace OpenIddict.EntityFramework
public class OpenIddictScopeStore<TContext> : OpenIddictScopeStore<OpenIddictScope, TContext, string>
where TContext : DbContext
{
public OpenIddictScopeStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictScopeStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
: base(cache, context, options)
{
}
}
@ -46,10 +50,14 @@ namespace OpenIddict.EntityFramework
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictScopeStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictScopeStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -62,6 +70,11 @@ namespace OpenIddict.EntityFramework
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TScope"/> entity.
/// </summary>

19
src/OpenIddict.EntityFramework/Stores/OpenIddictTokenStore.cs

@ -17,6 +17,7 @@ using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -33,8 +34,11 @@ namespace OpenIddict.EntityFramework
OpenIddictAuthorization, TContext, string>
where TContext : DbContext
{
public OpenIddictTokenStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictTokenStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
: base(cache, context, options)
{
}
}
@ -54,10 +58,14 @@ namespace OpenIddict.EntityFramework
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictTokenStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictTokenStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -70,6 +78,11 @@ namespace OpenIddict.EntityFramework
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TApplication"/> entity.
/// </summary>

26
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictApplicationStore.cs

@ -18,6 +18,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -34,8 +35,11 @@ namespace OpenIddict.EntityFrameworkCore
OpenIddictToken, TContext, string>
where TContext : DbContext
{
public OpenIddictApplicationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictApplicationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -51,8 +55,11 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictApplicationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictApplicationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -72,10 +79,14 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictApplicationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictApplicationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -88,6 +99,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkCoreOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TApplication"/> entity.
/// </summary>

26
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictAuthorizationStore.cs

@ -18,6 +18,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -34,8 +35,11 @@ namespace OpenIddict.EntityFrameworkCore
OpenIddictToken, TContext, string>
where TContext : DbContext
{
public OpenIddictAuthorizationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictAuthorizationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -51,8 +55,11 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictAuthorizationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictAuthorizationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -72,10 +79,14 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictAuthorizationStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictAuthorizationStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -88,6 +99,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkCoreOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TApplication"/> entity.
/// </summary>

26
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictScopeStore.cs

@ -14,6 +14,7 @@ using System.Threading.Tasks;
using JetBrains.Annotations;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -28,8 +29,11 @@ namespace OpenIddict.EntityFrameworkCore
public class OpenIddictScopeStore<TContext> : OpenIddictScopeStore<OpenIddictScope, TContext, string>
where TContext : DbContext
{
public OpenIddictScopeStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictScopeStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -43,8 +47,11 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictScopeStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictScopeStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -60,10 +67,14 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictScopeStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictScopeStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -76,6 +87,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkCoreOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TScope"/> entity.
/// </summary>

26
src/OpenIddict.EntityFrameworkCore/Stores/OpenIddictTokenStore.cs

@ -18,6 +18,7 @@ using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OpenIddict.Abstractions;
@ -34,8 +35,11 @@ namespace OpenIddict.EntityFrameworkCore
OpenIddictAuthorization, TContext, string>
where TContext : DbContext
{
public OpenIddictTokenStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictTokenStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -51,8 +55,11 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictTokenStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
: base(cache, context)
public OpenIddictTokenStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
: base(cache, context, options)
{
}
}
@ -72,10 +79,14 @@ namespace OpenIddict.EntityFrameworkCore
where TContext : DbContext
where TKey : IEquatable<TKey>
{
public OpenIddictTokenStore([NotNull] IMemoryCache cache, [NotNull] TContext context)
public OpenIddictTokenStore(
[NotNull] IMemoryCache cache,
[NotNull] TContext context,
[NotNull] IOptions<OpenIddictEntityFrameworkCoreOptions> options)
{
Cache = cache;
Context = context;
Options = options;
}
/// <summary>
@ -88,6 +99,11 @@ namespace OpenIddict.EntityFrameworkCore
/// </summary>
protected TContext Context { get; }
/// <summary>
/// Gets the options associated with the current store.
/// </summary>
protected IOptions<OpenIddictEntityFrameworkCoreOptions> Options { get; }
/// <summary>
/// Gets the database set corresponding to the <typeparamref name="TApplication"/> entity.
/// </summary>

Loading…
Cancel
Save