diff --git a/src/OpenIddict.EntityFramework.Models/OpenIddictApplication.cs b/src/OpenIddict.EntityFramework.Models/OpenIddictApplication.cs
index 2134d879..e60df750 100644
--- a/src/OpenIddict.EntityFramework.Models/OpenIddictApplication.cs
+++ b/src/OpenIddict.EntityFramework.Models/OpenIddictApplication.cs
@@ -29,7 +29,7 @@ namespace OpenIddict.EntityFramework.Models
///
/// Gets the list of the authorizations associated with this application.
///
- public virtual IList Authorizations { get; } = new List();
+ public virtual ICollection Authorizations { get; } = new HashSet();
///
/// Gets or sets the client identifier
@@ -94,7 +94,7 @@ namespace OpenIddict.EntityFramework.Models
///
/// Gets the list of the tokens associated with this application.
///
- public virtual IList Tokens { get; } = new List();
+ public virtual ICollection Tokens { get; } = new HashSet();
///
/// Gets or sets the application type
diff --git a/src/OpenIddict.EntityFramework.Models/OpenIddictAuthorization.cs b/src/OpenIddict.EntityFramework.Models/OpenIddictAuthorization.cs
index 2343329a..7ebfd69d 100644
--- a/src/OpenIddict.EntityFramework.Models/OpenIddictAuthorization.cs
+++ b/src/OpenIddict.EntityFramework.Models/OpenIddictAuthorization.cs
@@ -67,7 +67,7 @@ namespace OpenIddict.EntityFramework.Models
///
/// Gets the list of tokens associated with the current authorization.
///
- public virtual IList Tokens { get; } = new List();
+ public virtual ICollection Tokens { get; } = new HashSet();
///
/// Gets or sets the type of the current authorization.
diff --git a/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkBuilder.cs b/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkBuilder.cs
index 202a2a2c..c3a99690 100644
--- a/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkBuilder.cs
+++ b/src/OpenIddict.EntityFramework/OpenIddictEntityFrameworkBuilder.cs
@@ -8,6 +8,7 @@ using System;
using System.ComponentModel;
using System.Data.Entity;
using JetBrains.Annotations;
+using Microsoft.Extensions.DependencyInjection.Extensions;
using OpenIddict.Core;
using OpenIddict.EntityFramework;
using OpenIddict.EntityFramework.Models;
@@ -82,6 +83,8 @@ namespace Microsoft.Extensions.DependencyInjection
throw new ArgumentException("The specified type is invalid.", nameof(type));
}
+ Services.TryAddScoped(type);
+
return Configure(options => options.DbContextType = type);
}
diff --git a/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictApplication.cs b/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictApplication.cs
index 9b11b33b..e5306535 100644
--- a/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictApplication.cs
+++ b/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictApplication.cs
@@ -36,7 +36,7 @@ namespace OpenIddict.EntityFrameworkCore.Models
///
/// Gets the list of the authorizations associated with this application.
///
- public virtual IList Authorizations { get; } = new List();
+ public virtual ICollection Authorizations { get; } = new HashSet();
///
/// Gets or sets the client identifier
@@ -101,7 +101,7 @@ namespace OpenIddict.EntityFrameworkCore.Models
///
/// Gets the list of the tokens associated with this application.
///
- public virtual IList Tokens { get; } = new List();
+ public virtual ICollection Tokens { get; } = new HashSet();
///
/// Gets or sets the application type
diff --git a/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictAuthorization.cs b/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictAuthorization.cs
index 608080b6..67cc0272 100644
--- a/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictAuthorization.cs
+++ b/src/OpenIddict.EntityFrameworkCore.Models/OpenIddictAuthorization.cs
@@ -74,7 +74,7 @@ namespace OpenIddict.EntityFrameworkCore.Models
///
/// Gets the list of tokens associated with the current authorization.
///
- public virtual IList Tokens { get; } = new List();
+ public virtual ICollection Tokens { get; } = new HashSet();
///
/// Gets or sets the type of the current authorization.