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

  • Home
  • SEARCH
  • 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 883177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:32:43+00:00 2026-05-15T12:32:43+00:00

I am an Entity Framework newbie and am wondering if I am able to

  • 0

I am an Entity Framework newbie and am wondering if I am able to use it in the way I would like to. I am using Visual Studio 2010 and .NET 4.

I have a Content Management system which stores all the data in an xml field of a table. The table – cmsContent – contains only two fields, id and XmlNode

I want to create stored procs that query the XML field to bring back meaningful data, Product data in this case. e.g…

SELECT
C.id AS [Id],
C.xmlNode.value(‘(/node/data[@alias = ”ProdName”])[1]’, ‘NVARCHAR(1024)’) AS ProductName,
C.xmlNode.value(‘(/node/data[@alias = ”ProdDesc”])[1]’, ‘NVARCHAR(1024)’) AS ProductDescription
FROM cmsContent C
WHERE
C.xNode.query(‘data(/node[1]/@nodeTypeAlias)’).value(‘.’, ‘VARCHAR(30)’) = ‘Product’

I then want to map the output of these stored procs to my entity classes via a the EDMX enity diagram. So I would want to map the above query to a class called Products. The products class will be read only, there is no need to upate these object as this is doen via the CMS.

Would this be posssible to use the entiry framework in this way? If so how, as I can’t get the Stored Procs to generate the required classes in the EDMX diagram as this doesn’t happen when i use the wizard?

  • 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-15T12:32:43+00:00Added an answer on May 15, 2026 at 12:32 pm

    If it’s readonly, then you can provide a DefiningQuery for the EntitySet in the Storage Model. This essentially acts as a read-only view of the store and you can define the result shape however you want. You can then either map it to an entity or a complex type (tho a complex type may be easier if it’s read-only.)

    <Schema ...>
      <EntityContainer ...>
        <EntitySet Name="blah" EntityType="BlahModel.Store.blah">
          <DefiningQuery>
            select ... from blah
          </DefiningQuery>
        </EntitySet>
      </EntityContainer>
      ...
    </Schema>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Entity Framework 4.1 code first and POCO entities in MVC3; I would like
I'm newbie with .NET Entity Framework 4.0 I'm using VS2010 and I created the
Using Entity Framework Code First, I have something like: public class Foo { public
Using Entity Framework and Oracle DB, I would like to insert into tablename (datetimefield,
I'm a total newbie at Entity Framework and ASP.Net MVC, having learned mostly from
Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc
I'm a newbie to Entity Framework, so I'd like to try something simple to
We are using ado.net entity framework 4.0 for our database layer and I am
Using Entity Framework I have the fields: o CreatedOn (datetime) o CreatedBy (nvarchar(50)) o
Using Entity Framework 4.3 in one of my data access classes I have generic

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.