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 782697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:25:38+00:00 2026-05-14T20:25:38+00:00

I have a class generated from a WSDL that has a bunch of public

  • 0

I have a class generated from a WSDL that has a bunch of public properties and a public event. I’m extending this class with my own and adding some properties to it. All of my own properties are declared virtual, but the base class properties are not virtual.

I’m using Fluent NHibernate’s ClassMap to map only the properties from my extended class. How do I prevent (Fluent)NHibernate from trying to persist all the base class’s public members?

At the moment, I get the following exception when creating the ISessionFactory:

NHibernate.InvalidProxyTypeException: The following types may not be used as proxies:

Type: method get_<BaseClassProperty> should be ‘public/protected virtual’ or ‘protected internal virtual’

Type: method set_<BaseClassProperty> should be ‘public/protected virtual’ or ‘protected internal virtual’

…

Type: method add_<BaseClassEvent> should be ‘public/protected virtual’ or ‘protected internal virtual’

Type: method remove_<BaseClassEvent> should be ‘public/protected virtual’ or ‘protected internal virtual’

  • 1 1 Answer
  • 3 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-14T20:25:39+00:00Added an answer on May 14, 2026 at 8:25 pm

    Fluent NHibernate is not trying to persist all your public members. It’s the NHibernate proxying mechanism that requires all members to be virtual; they may or may not be used for persistence, but they’re needed anyway.

    You either need to disable lazy-loading and proxying for the entity, or (preferably!) expose a DTO in your WS rather than the entity directly.

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

Sidebar

Related Questions

I have a constructor (for an auto generated class) that has 255 paremeters. Using
I have a class that has the following property that is generated by the
I have a domain class User that has at least 20 properties, and it
I have a .NET web-service client that has been autogenerated from a wsdl-file using
I have a pymzml.run.Reader class from the pymzml package. This is a generator object,
I have a bunch of entity class (generated by Linq to SQL) with a
i have the following code: /** * @generated */ public class foo ... /**
I have a span that is generated through javascript, with its css class as
I have a public EJB class that I want accessible online as a web
I have a JAX-WS based application that I am developing. I generate WSDL from

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.