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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:09:07+00:00 2026-06-16T02:09:07+00:00

We currently use sp’s and udf’s to generate an XML document that is sent

  • 0

We currently use sp’s and udf’s to generate an XML document that is sent via web service to the client for consumption. I have used an ORM (Entity and Open Access) before but I alway interacted directly with a single class (table). If I had data that needed to goto multiple tables I would break it apart in code and just update the ORM class (table) the data belonged to.

I am wondering if I can get a bit more complicated. Can I somehow create a complex object in the ORM that is an aggregate of all these fields. In other words I would pass to the constructor of my complex orm object the record key desired. The object would then gather from all the tables the needed info and return to me the object…..which I could then serialize into xml and send on it’s way.

I understand that somewhere in the ORM or the DB I have to have the logic to gather all the pieces together so really just looking for input.

  • 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-06-16T02:09:08+00:00Added an answer on June 16, 2026 at 2:09 am

    If I want an object comprised of data from multiple tables I just add all the tables to the .edmx file. From there I can create a class that gets whatever I want. There’s no need for a 1:1 pairing. Within my method to create the object based on say the primary key from TableA you can just do;

        Obj GetObj(string primaryKey)
        {
            dataBase context = new dataBase();
              var obj = (from a
                         in context.TableA
                         where a.Id == primaryKey
                         select a);
              var otherObj = (from b
                              in context.TableB
                              where b.Id == a.ForeignKey
                              select b);
    
             Obj foo = new Obj();
    
             foo.Id = a.Id;
             foo.SomethingElse = a.Somthing;
             foo.FromB = b.Id;
             foo.AnInt = (int)b.count;
    
             return foo;
        }
    

    To save some changes;

       void AddNewObject()
       {
             dataBase context = new Context;
             TableA a = new TableA();
             TableB b = new TableB();
    
             a.Id = this.Id;
             a.OtherField = this.OtherField;
             b.Key = this.BKey;
             b.SomeInt = this.SomeInt;
    
             context.AddObject("TableA", a);
             context.AddObject("TableB", b);
    
             context.SaveChanges();
       }
    

    Of course these will need some error handling I haven’t included but the concept isn’t that different from when you have the standard EntityObject<->Table mapping. I think it’s simpler to keep some of the normal mapping then build your class on top of it.

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

Sidebar

Related Questions

I currently use Authlogic in a web-app to handle user authentication, but have now
We currently use subversion as our version control system, we have decided that we
We currently use LoadRunner for performance testing our web apps, but we also have
I currently use the rectangle shape xml tag to specify borders for my views
I currently use the free obfuscation tool that ships with VS and it does
We currently use DotLess on an ASP.NET web application hosted on IIS 6. In
I currently use jTemplates to create a rather large table on the client, each
I currently use the following function to register a dll that handles context menu
I currently use mechanize to read gzipped web page as below: br = mechanize.Browser()
I currently use a simple convention for my unit tests. If I have a

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.