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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:10:53+00:00 2026-05-21T11:10:53+00:00

I have Calls table: Call(id, reason_id, company_id, text) I have Reason table: Reason(id, name)

  • 0

I have Calls table:

Call(id, reason_id, company_id, text)   

I have Reason table:

Reason(id, name)  

I have Company table:

Company(id, name)  

Calls has a foreign key to Reason and Company

I am using Entity Framework 4 and I would like to display a list of calls and for each call display the text, reason name and company name.

Something like an inner join.

I have added the tables to the edmx file. how can I get the data I need? which POCO object will hold the external data (company name and reason name)?

  • 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-21T11:10:53+00:00Added an answer on May 21, 2026 at 11:10 am

    Maybe you can use the concept of ViewModel:

     //Create  CallViewModel contains ReasonName & CompanyName
        public class CallViewModel
        {
            public int id { get; set; }
            public string Text{ get; set; }
            public string ReasonName { get; set; }
            public string CompanyName { get; set; }
        }
    
    public List<CallViewModel> YourMethid()
    {
        using (Entities _entities = new Entities())
        {
            var result = (from s in _entities.Call.Include("Reason").Include("Company")
                          select new CallViewModel
                              {
                                  id = s.id,
                                  Text = s.Text,
                                  CompanyName = s.Company.name,
                                  ReasonName = s.Reason.name
                              }).ToList();
            return result;
        }
    }
    

    =======================
    //select all data from _entities Call Table

    var result = (from s in _entities.Call.Include(“Reason”).Include(“Company”) select s).ToList();

    //get first data’s ReasonName

    var ReasonName = result[0].Reason.ReasonName;

    //get first data’s CompanyName

    var CompanyName = result[0].Company.CompanyName;

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

Sidebar

Related Questions

I have a table (call it table myTable). It has the data like this:
I have a simple table (lets call it Table1) that has a NVARCHAR field
I have the following mapped classes: <class name=Company table=Company> <id name=ID column=CompanyID> <generator class=native/>
I have a table call lp_upload and it contain plate number of car and
I have to call the table() function on 10 variables in R. Is there
I have a jQuery ajax call that returns html of a table. Now I
I have a table, let's call is [MYTABLE] , with an FOR INSERT, UPDATE
I have problems filling a temporary table with the resultset from a procedure call
I have one table of items, let's call it ITEMS. Now I need to
I have a spreadsheet I created mid-August which has a table with one column

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.