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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:45:59+00:00 2026-05-16T02:45:59+00:00

I am using RIA services with Entity Framework- I have the following sql select

  • 0

I am using RIA services with Entity Framework- I have the following sql select statement:

select * from TaskTable t, MapTable mt where mt.SiteID=1 and t.EndPointID=mt.EndPointID

How do I write this using method queries and lamda, or any other way I can use in my domain services?

All the examples I see return a new object- do I really have to do this? I thought this would be a pretty simple thing but I haven’t found the solultion yet.

I want to do something like:

public void IQueryable<Task> GetTasksFromID(int id)
{
    return this.ObjectContext.TaskTable.Where(e => e.SiteID=id)...????
}
  • 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-16T02:46:00+00:00Added an answer on May 16, 2026 at 2:46 am

    You don’t have to put a projection at the end normally – but it looks like you’ve got two tables involved. Your SQL query is pulling back all the columns, including those from the map table. If you only want the tasks, you don’t need those. Try this:

    return from task in ObjectContext.TaskTable
           join map in ObjectContext.MapTable
             on task.EndPointID equals map.EndPointID
           where map.SiteID == id
           select task;
    

    (I’ve been basing the query on the SQL more than the LINQ you provided – from the SQL it looks like SiteID is part of the map rather than the task.)

    You can write this in dot notation instead of as a query expression, but it’s uglier:

    return Object.ContextTable.Join(ObjectContext.MapTable
                                                 .Where(map => map.SiteID = id),
                                    task => task.EndPointID,
                                    map => map.EndPointID,
                                    (task, map) => task);
    

    (Note that I’ve moved the Where clause here as it ends up being simpler before the join itself in this case. You could do the same in the query expression query too, but again it wouldn’t look as nice.)

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

Sidebar

Ask A Question

Stats

  • Questions 505k
  • Answers 505k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The only problem that I can see is that you're… May 16, 2026 at 3:28 pm
  • Editorial Team
    Editorial Team added an answer Rather than using a character, use: NSString *dicttxt = [[myword… May 16, 2026 at 3:28 pm
  • Editorial Team
    Editorial Team added an answer set a UIButton as UINavigationItem's titleView.. add an action to… May 16, 2026 at 3:28 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have been experimenting recently with Silverlight, RIA Services, and Entity Framework using .NET
I have a Silverlight 3 app using WCF RIA Services and Entity Framework for
I am creating a Silverlight 4 application with Entity Framework, RIA Services and MVVM-Light
So i have been playing around with the .NET RIA Services with Silverlight, and
I have written a RIA using flex for the front-end and Java servlet for
Was I was previously messing with Silverlight and RIA, I was using a an
I have a Sybase ASE server that I'm able to connect to with ASE
I'm a little stumped on this one. Anyone have any ideas? I'll try to
I have a Solution with several projects in it, including two asp.net mvc projects
I am in the beginning of my thesis, and I have to implement 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.