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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:15:51+00:00 2026-06-12T06:15:51+00:00

all… I’m using RavenDB embedded, latest stable build using NuGet and MVC 3. public

  • 0

all…

I’m using RavenDB embedded, latest stable build using NuGet and MVC 3.

    public JsonResult GetStudents(GridFilter filter)
    {
        using (var session = _store.OpenSession())
        {
            var students = session.Query<Student>();
            students.OrderBy(x => x.FirstName);

            return Json(students.ToList());
        }
    }

This code doesn’t break. It also doesn’t sort on Student.FirstName. I looked at the RavenQueryInspector (mousing over the students collection) and found the following…

AsyncDatabaseCommands = '(((Raven.Client.Linq.RavenQueryInspector<UMA.KendoGrid.Entities.Student>)(students))).AsyncDatabaseCommands' threw an exception of type 'System.NotSupportedException'

If I do

var students = from x in session.Query<Student>()
        orderby x.FirstName descending
        select x;

that works fine. First, I don’t understand why using lambda fails when using the long linq syntax works. What I REALLY need is to filter students by any field, as I’m using a grid with sort ability. I would like to use the System.Linq.Dynamic file from Microsoft to sort by string name, that way I can sort by whatever fields are passed in my sort collection.

But, to get started, I think I need to figure out why my version of RavenDB embedded won’t allow me to use lambda expressions. Can anyone help?

  • 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-12T06:15:52+00:00Added an answer on June 12, 2026 at 6:15 am

    On this statement:

    students.OrderBy(x => x.FirstName);
    

    … you’re ignoring the result of the call. It’s the LINQ equivalent of the “ignoring the result of a string call” bug:

    text.Substring(5, 10);
    

    LINQ calls never change what they’re called on – they return a new collection with the appropriate transformation. So you want:

    students = students.OrderBy(x => x.FirstName);
    

    Or, better:

    var students = session.Query<Student>.OrderBy(x => x.FirstName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

All -- I have these two methods in one of my classes: public static
All, I am building a small site using PHP. In the site, I receive
All, I'm using wordpress with this and for some reason the eventDrop stopped working.
All, I'm using Facebook Connect (JS SDK) to authenticate a user to my site.
All - I'm using stripes to do some form input for a problem I'm
All, I'm using the JSON Perl module to encode JSON. I'd like the resulting
All, I am using the following URI path to query data for the calendar,
all creating a cakephp(using 2.1.2) page. we prompt the user to enter how many
All, I'm inserting some text from a textarea in a mySQL database. I'm using
All, I'm a beginner user of Eclipse. I am currently using it for 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.