Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 553639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:37:35+00:00 2026-05-13T11:37:35+00:00

I have an object with a property that I’d like to map as Serializable.

  • 0

I have an object with a property that I’d like to map as Serializable. NHibernate supports this:

<property name="FeeGenerator" column="FeeGenerator" type="Serializable"  />

Is there a way to accomplish this in Fluent NHibernate?

There’s an SO question (Map to Serializable in Fluent NHibernate) that would seem to address this, but the only response there doesn’t work for me.

If I set

CustomType<NHibernate.Type.SerializableType>();

I get the following Exception:

Could not instantiate IType SerializableType: System.MissingMethodException: No parameterless constructor defined for this object.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:37:36+00:00Added an answer on May 13, 2026 at 11:37 am

    I’m surprised that nobody seems to know the answer to this. I did find the answer, and I figured I’d share it.

    Basically, you can use the CustomType method to map to any NHibernate type just like you would in XML because there’s an overload that takes a string. So the following

    CustomType("Serializable");
    

    outputs

    <property name="PropertyName" type="Serializable"> ...
    

    I also blogged about this (with some background and more details) over at http://blog.statichippo.com/archive/2010/01/20/mapping-serializable-types-using-fluent-nhibernate.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a serializable Message class that has a Data As Object property that
I have an object with a property called name. This object has a sub
I have some text that looks like: California(2342) My object has a property that
I have a cache object property that I'd like to set to the current
I have a Product object with a property that is a collection of type
I have a custom object type dependency property that is being populated at runtime.
I have an object which looks for example like this Name Number ---- ------
So I have an object that implements INotifyPropertyChanged, and I have a property that
I have persistent object, with a string property that often is over 500 charachters.
D2.0 classes have a __monitor class property that gives access to the class object's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.