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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:12:03+00:00 2026-05-30T02:12:03+00:00

I am working on an ASP.NET MVC application. This application executes a query via

  • 0

I am working on an ASP.NET MVC application. This application executes a query via JQuery. The result set is returned as JSON from my ASP.NET MVC controller. Before I return the serialized result set, i need to trim it down to only the properties I need. To do this, I’m using a LINQ Query. That LINQ Query looks like the following:

private IEnumerable RefineResults(ResultList<Result> results)
{           
  // results has three properties: Summary, QueryDuration, and List
  var refined = results.Select(x => new
  {
    x.ID, x.FirstName, x.LastName
  });

  return refined;
}

When I execute this method, I’ve noticed that refined does not include the Summary and Duration properties from my original query. I’m want my result set to be structured like:

Summary
QueryDuration
Results
 - Result 1
 - Result 2
 - Result 3
 ...

At this time, when I execute RefineResults, I get the result list I would expect. However, I can’t figure out how to put those entries in a property called “Results”. I also don’t know how to add the “Summary” and “QueryDuration” properties.

Can someone please point me in the right direction?

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-30T02:12:04+00:00Added an answer on May 30, 2026 at 2:12 am
    private object RefineResults(ResultList<Result> results)
    {           
      // results has three properties: Summary, QueryDuration, and List
      var refined = results.Select(x => new
      {
        x.ID, x.FirstName, x.LastName
      });
    
      return new { Results = refined, Summary = results.Summary, QueryDuration = results.QueryDuration };
    }
    

    You will probably want to create a specific DTO class for the return value of this function.

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

Sidebar

Related Questions

I am working on an ASP.NET MVC application and using jQuery. I understand from
I'm working on an asp.net MVC 3 application which is using Data Models from
I've been working on my first major ASP.NET MVC application (plus lots of jQuery)
I'm working on a view in a ASP.NET MVC 2 application. This view will
I am working on an ASP.NET MVC application that contains a header and menu
I am working on an ASP.NET MVC application where I need to export data
I'm working on an ASP.NET MVC application. The app is broken up into a
I'm working on an asp.net-mvc application. The linq data context is being passed into
I am working with an ASP.NET MVC application. I have one master page having
I upgraded a large ASP.NET MVC application I've been working on to the latest

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.