Skip to content
This repository was archived by the owner on Dec 20, 2018. It is now read-only.
This repository was archived by the owner on Dec 20, 2018. It is now read-only.

Pass in DbContextOptions to *.IdentityDbContext for all version of IdentityDbContext <> #652

@SychevIgor

Description

@SychevIgor

We need to configure dbcontext as it mentioned here: https://github.com/aspnet/EntityFramework/wiki/Configuring-a-DbContext

It's cool that we make it possible to pass DbContextOptions via constructor for this class:

  public class IdentityDbContext<TUser, TRole, TKey> : DbContext
        where TUser : IdentityUser<TKey>
        where TRole : IdentityRole<TKey>
        where TKey : IEquatable<TKey>

#570
#418

But for 2 others we still can't do it without modifications of our context:

    /// <summary>
    /// Base class for the Entity Framework database context used for identity.
    /// </summary>
    public class IdentityDbContext : IdentityDbContext<IdentityUser, IdentityRole, string> { }

    /// <summary>
    /// Base class for the Entity Framework database context used for identity.
    /// </summary>
    /// <typeparam name="TUser">The type of the user objects.</typeparam>
    public class IdentityDbContext<TUser> : IdentityDbContext<TUser, IdentityRole, string> where 
        TUser : IdentityUser { }

As a result you are forcing us to inherit our dbcontext from IdentityDbContext : IdentityDbContext<IdentityUser, IdentityRole, string> and making the other 2 others versions IdentityDbContext<TUser>, IdentityDbContext completely useless.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions