Comments (8)
NHibernate.Exceptions.GenericADOException: 'Failed to execute multi query[SQL: select applicatio0_.applicationuser_key as id1_30_0_, identityro2_.Id as id1_33_1_, applicatio0_1_.AccessFailedCount as acces2_30_0_, applicatio0_1_.Email as email3_30_0_, applicatio0_1_.EmailConfirmed as email4_30_0_, applicatio0_1_.LockoutEnabled as locko5_30_0_, applicatio0_1_.LockoutEndDateUtc as locko6_30_0_, applicatio0_1_.PasswordHash as passw7_30_0_, applicatio0_1_.PhoneNumber as phone8_30_0_, applicatio0_1_.PhoneNumberConfirmed as phone9_30_0_, applicatio0_1_.TwoFactorEnabled as twof10_30_0_, applicatio0_1_.UserName as user11_30_0_, applicatio0_1_.SecurityStamp as secu12_30_0_, identityro2_.Name as name2_33_1_, roles1_.UserId as useri1_31_0__, roles1_.RoleId as rolei2_31_0__ from ApplicationUser applicatio0_ inner join AspNetUsers applicatio0_1_ on applicatio0_.applicationuser_key=applicatio0_1_.Id left outer join AspNetUserRoles roles1_ on applicatio0_.applicationuser_key=roles1_.UserId left outer join AspNetRoles identityro2_ on roles1_.RoleId=identityro2_.Id where upper(applicatio0_1_.UserName)=?; select applicatio0_.applicationuser_key as id1_30_0_, claims1_.Id as id1_34_1_, applicatio0_1_.AccessFailedCount as acces2_30_0_, applicatio0_1_.Email as email3_30_0_, applicatio0_1_.EmailConfirmed as email4_30_0_, applicatio0_1_.LockoutEnabled as locko5_30_0_, applicatio0_1_.LockoutEndDateUtc as locko6_30_0_, applicatio0_1_.PasswordHash as passw7_30_0_, applicatio0_1_.PhoneNumber as phone8_30_0_, applicatio0_1_.PhoneNumberConfirmed as phone9_30_0_, applicatio0_1_.TwoFactorEnabled as twof10_30_0_, applicatio0_1_.UserName as user11_30_0_, applicatio0_1_.SecurityStamp as secu12_30_0_, claims1_.ClaimType as claim2_34_1_, claims1_.ClaimValue as claim3_34_1_, claims1_.UserId as useri4_34_1_, claims1_.UserId as useri4_34_0__, claims1_.Id as id1_34_0__ from ApplicationUser applicatio0_ inner join AspNetUsers applicatio0_1_ on applicatio0_.applicationuser_key=applicatio0_1_.Id left outer join AspNetUserClaims claims1_ on applicatio0_.applicationuser_key=claims1_.UserId where upper(applicatio0_1_.UserName)=?; select applicatio0_.applicationuser_key as id1_30_, applicatio0_1_.AccessFailedCount as acces2_30_, applicatio0_1_.Email as email3_30_, applicatio0_1_.EmailConfirmed as email4_30_, applicatio0_1_.LockoutEnabled as locko5_30_, applicatio0_1_.LockoutEndDateUtc as locko6_30_, applicatio0_1_.PasswordHash as passw7_30_, applicatio0_1_.PhoneNumber as phone8_30_, applicatio0_1_.PhoneNumberConfirmed as phone9_30_, applicatio0_1_.TwoFactorEnabled as twof10_30_, applicatio0_1_.UserName as user11_30_, applicatio0_1_.SecurityStamp as secu12_30_, logins1_.UserId as useri1_32_0__, logins1_.LoginProvider as login2_32_0__, logins1_.ProviderKey as provi3_32_0__ from ApplicationUser applicatio0_ inner join AspNetUsers applicatio0_1_ on applicatio0_.applicationuser_key=applicatio0_1_.Id left outer join AspNetUserLogins logins1_ on applicatio0_.applicationuser_key=logins1_.UserId where upper(applicatio0_1_.UserName)=?; select applicatio0_.applicationuser_key as id1_30_, applicatio0_1_.AccessFailedCount as acces2_30_, applicatio0_1_.Email as email3_30_, applicatio0_1_.EmailConfirmed as email4_30_, applicatio0_1_.LockoutEnabled as locko5_30_, applicatio0_1_.LockoutEndDateUtc as locko6_30_, applicatio0_1_.PasswordHash as passw7_30_, applicatio0_1_.PhoneNumber as phone8_30_, applicatio0_1_.PhoneNumberConfirmed as phone9_30_, applicatio0_1_.TwoFactorEnabled as twof10_30_, applicatio0_1_.UserName as user11_30_, applicatio0_1_.SecurityStamp as secu12_30_ from ApplicationUser applicatio0_ inner join AspNetUsers applicatio0_1_ on applicatio0_.applicationuser_key=applicatio0_1_.Id where upper(applicatio0_1_.UserName)=?; ]'
from nhibernate.aspnet.identity.
I'm having the same issue.
It tries to select against this "ApplicationUser" table, but it does not exists in .NET Identity Tables (as far as I know). Just created a MVC5 application with Identity Login and this table is not there.
Anyone has a clue on this?
from nhibernate.aspnet.identity.
Solved the problem by creating ApplicationUser table in the database as below:
CREATE TABLE ApplicationUser(
applicationuser_key NVARCHAR(128) PRIMARY KEY
)
ALTER TABLE ApplicationUser WITH CHECK ADD CONSTRAINT [FK_ApplicationUser_AspNetUsers] FOREIGN KEY(applicationuser_key)
REFERENCES AspNetUsers (Id)
After this everything seems normal.
The thing is: I do not know why this table is needed.
Should I really create it myself? Is it structure complete/correct?
from nhibernate.aspnet.identity.
There are always two tables for the users: aspnetuser and one with the name of your application user class, in this case ApplicationUser. How did you create your schema? You should create it with the script generated by the ScriptGenerator from NHibernate. If you try the sample provided, you'll see what are the generated tables.
// this NHibernate tool takes a configuration (with mapping info in)
// and exports a database schema from it
new SchemaExport(_configuration)
.SetOutputFile(path)
.Create(true, true /* DROP AND CREATE SCHEMA */);
from nhibernate.aspnet.identity.
How did you create your schema?
I created a MVC5 Application from scratch and had EF create it for me. This way ApplicationUser table is not created.
If you try the sample provided, you'll see what are the generated tables.
I'll give it a try.
Thanks.
from nhibernate.aspnet.identity.
I created an empty database and ran SchemaExport on it. All tables were created normally, including ApplicationUser.
Everything seems to work as intended with this schema.
from nhibernate.aspnet.identity.
The ApplictionUser
object is used to store extra properties. All extra properties will be added to the corresponding ApplicationUser
table. It's table per subclass mapping. If you don't need extra properties you can directly use IdentityUser
I think.
from nhibernate.aspnet.identity.
I see, I'm really grateful.
Thanks for the help =]
from nhibernate.aspnet.identity.
Related Issues (20)
- Setup CI
- Move to NHibernate organization? HOT 4
- Fluent Nhibernate
- Unable to access properties from AspNetUsers table HOT 1
- Unable to Build the Solution HOT 4
- Quick Start HOT 5
- Use with the last Sharp Architecture HOT 3
- `IdentityUser` is not generic. HOT 6
- Please Update the nuget references HOT 1
- Any way to change the User ID from a GUID to int? HOT 12
- Are you missing SaveUpdate in UserStore AddClaims,RemoveClaims? HOT 2
- Problem IdentityConfig HOT 3
- HttpContext.Current.ApplicationInstance Problem
- Using NHibernate.AspNet.Identity with Identity Core HOT 3
- Compatibility with NHibernate 5.0.0 HOT 3
- Make database operations asynchronous
- Error when get all users HOT 5
- Using NHibernate.AspNet.Identity with Identity Core HOT 11
- Current threads of different cultures may cause potential problems. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nhibernate.aspnet.identity.