-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserStore and RoleStore to depend on ISessionFactory / ICurrentSessionContext instead of ISession? #25
Comments
/cc @lnu @DennisFrostlander @milesibastos |
Just my 2c - I would prefer "in addition to" ISession to "instead of". With the current variety of IoC containers with their own 'per-request' lifetime scopes, async owin frameworks etc, I often find it easier to open session myself and rely on IoC's capabilities for lifetime management than use Nhibernate's contexts. |
I also prefer to manage the session myself. I'd also rather stick to the EF implementation as much as possible. But if the option of could be added while keeping the current implementation, it's ok for me. |
Has anyone gotten this to work with Unity IoC container? |
Something like that:
We first register an injection factory to resolve ISession. Then we configure injection for IRoleStore and IUserStore and for our custom Managers. Seems ok for you? |
@lnu, thanks for your input. I am still unable to get it to work. Do you have a extremely stripped down sample project on github which uses ASP.NET MVC, NHibernate.AspNet.Identity and Unity IoC that i can pull from? Basically, VS can't resolve EcdtRole, EcdtUser, EcdtUserManager. Where did you get these models from? |
is this enough https://github.com/lnu/NHibernateIdentity? ps: everything related to Ecdt is custom implementation for one of my project On Thu, Apr 9, 2015 at 3:11 PM, Eric Whitmore [email protected]
|
I will check it out. Thanks! |
I've updated the project |
Does this method work with asp.net identity managers? I enabled role manager in the web.config () but when i try to actually create a role (roles.create("Admin");) i get the following error: Additional information: Unable to connect to SQL Server database. Am i missing something? |
What do you mean by ASP.NET identity managers? |
https://msdn.microsoft.com/en-us/library/system.web.security.roles.createrole(v=vs.110).aspx for example. if i try to do something like
I get the error: Additional information: Unable to connect to SQL Server database. |
This code works with the old membership system and forms authentication. I don't think it still works with Asp.Net Identity. |
No description provided.
The text was updated successfully, but these errors were encountered: