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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:52:21+00:00 2026-05-26T00:52:21+00:00

How do I go about mapping an xml table column to an XElement property

  • 0

How do I go about mapping an xml table column to an XElement property in a POCO object.

Is there a way to map it using a complex type, or supply the EF framework with a conversion function of some kind so that I can use XElement as the property type and use it as xml in the database.

I am hoping that the fluent api has some way of mapping this, but my searching has yielded no results, and it appears that the question is not as common as I would have thought.

Thanks.

  • 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-26T00:52:22+00:00Added an answer on May 26, 2026 at 12:52 am

    No there is no support for that and fluen-API will also not help you. EF also doesn’t have any thing like conversion functions (I would call it simply type mapping).

    What you can try is workaround usually used when conversion is needed – you need two properties. One will be string and mapped to your XML column (I didn’t try it but I hope it will work) and second will by not mapped XElement. The second property will internally convert from and to first string property. Something like:

    public class YourEntity
    {
        public string MappedProperty { get; set; }
    
        public XElmenet NotMappedProperty 
        {
            get 
            {
                return XElement.Parse(MappedProperty);
            }
            set
            {
                // Some validation
                MappedProperty = value.ToString();
            }
        }
    }
    

    It is not nice and it doesn’t make your entity interface nice but EF doesn’t provide anything better at the moment.

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

Sidebar

Related Questions

I'm trying to generate POJO's from mapping xml files. I read something about adding
The question is about JAXB Map marshalling - there is plenty of examples on
Hi is there good tutorial about using Fluent Nhibernate in asp.net/winforms application ? I
I am confused about the way the DefaultAnnotationHandlerMapping works. In my web.xml I have
Hello I am using Hibernate 3.6 with XML mapping (no annotations). I tried to
Is there a way in NHibernate to map the result of a count query
I can find tutorials about mapping textures to polygons specifying vertices etc. but nothing
About 10 years ago, I was using a computer language called INFO on an
About 5 times over the past 6 months, in complex javascripts, I'll get an
About five years ago I started using Generic lookup Tables for applications I was

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.