digipolisantwerp / dataaccess_aspnetcore_deprecated

Generic repository/unit of work framework for ASP.NET Core with Entity Framework.
Other
140 stars 45 forks source link

How to work fine with IdentityDbContext #32

Closed FreezeSoul closed 7 years ago

FreezeSoul commented 7 years ago

how to compatible asp.net identity:

my code is here: public class MyContext : IdentityDbContext<User, Role, long> public partial class User : IdentityUser

can EntityBase and EntityContextBase change to interface?

StevenVandenBroeck commented 7 years ago

Hi, our framework is not compatible with the ASP.NET Identity package. They use their own structure to query/update the database (RoleStore, UserStore, ...). You can use our framework for your own data access code and entities.

FreezeSoul commented 7 years ago

thanks, i'll try it

mortenbirkelund commented 7 years ago

Are there any workaround for this, except creating another context? Currently I use only one context for the whole application, I would like to continue doing so. But i would also like to use your awesome project ;)

anhlee24 commented 7 years ago

Are there a solution for it? this project very good and i like it.

StevenVandenBroeck commented 7 years ago

Sorry @mortenbirkelund and @anhlee24 but there is no out-of-the-box solution for this. The ASP.NET Core Identity package uses its own structure to access the database. What you can do is create 1 DbContext with our framework for your business data access and another DbContext for the Identity stuff.

anhlee24 commented 7 years ago

@StevenVandenBroeck no problem. thanks for your reply so much.

Can you add some methods for working with Store procedure or View. It will very great!

StevenVandenBroeck commented 7 years ago

@anhlee24, you can do this easily yourself by writing a custom repository, inheriting from RepositoryBase.