Git Product home page Git Product logo

Comments (5)

beginor avatar beginor commented on June 27, 2024
System.Data.SqlClient.SqlException (0x80131904): String or binary data would be truncated.

Please check the length of your columns, this exception is usually caused by the length of content exceeds the column's length definition.

And since you have called AddIdentityMappingsForSqlServer , AppUser should be mapped as joined-subclass, please check the mapping file AppUser.hbm.xml in the WebTest project, I think Fluent Hiberate can do joined subclass mapping too.

Please use the sql scripts in the database folder to create your identity tables, because it is more accurate then the SchemaUpdate .

from nhibernate.aspnetcore.identity.

Meberem avatar Meberem commented on June 27, 2024

Thanks for your reply. Strangely I was able to run the SQL statement manually, not entirely sure what was going on there. I have tried to add AppUser as a SubClassMap but it appears it is not picked up properly. Looking into it, based on this issue I don't think that is possible to have a joined-subclass in Fluent Hiberate when the base is in an xml file. What would your advice be for this? With my very limited knowledge of NHiberate I think I have 2 options:

  • Create FluentMappings based of the AppUser.hbm.xml
  • Don't use FluentHiberate and create my own *.hbm.xml

from nhibernate.aspnetcore.identity.

beginor avatar beginor commented on June 27, 2024

I have seen the issue, it seems joined-subclass mapping is not supported by FluentNHibernate know. But you have 3 options:

  1. Create all mappings for all classes, include NHibernate.AspNetCore.Identity 's classes , please refer to the exists hbm mappings;
  2. Just use *.hbm.xml files , don't use FluentHiberate;
  3. Use NHibernate.Mapping.Attributes, it support joined-subclass mapping with the existing hbm xml mapping , which I have tested with it before。

Personaly, I prefer to use xml mapping (*.hbm.xml), because both FluentHiberate and NHibernate.Mapping.Attributes will translate it's mapping to xml mapping at runtime. And with the help of NHibernate's xml schema (nhibernate-configuration.xsd and nhibernate-mapping.xsd) file, editing hbm file with intelli popup is easy too.

from nhibernate.aspnetcore.identity.

Meberem avatar Meberem commented on June 27, 2024

Thanks for your thoughts and insights on this, it has been very helpful!

from nhibernate.aspnetcore.identity.

beginor avatar beginor commented on June 27, 2024

you are welcome. If there is nothing else, I think this issue can be closed.

from nhibernate.aspnetcore.identity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.