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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:18:52+00:00 2026-06-01T22:18:52+00:00

I have updated my project with the MongoDb C# Driver 1.4 and one of

  • 0

I have updated my project with the MongoDb C# Driver 1.4 and one of my Lambda expression is not working anymore.

Before I was using MongoDb C# Driver 1.3.1 with Fluent Mongo to support Linq.

Here is my method:

IQueryable<T> IBackend<T>.Get(System.Linq.Expressions.Expression<Func<T, bool>> expression)
{
    return collection.AsQueryable<T>().Where(expression);
}

This lambda expression works:

var addedCustomer = repo.Get(c => c.FirstName == "Elwood").SingleOrDefault();

This one now throws an exception:

var updatedCustomer = repo.Get(c => c.Id == customer.Id).SingleOrDefault();

Thrown exception message:

Object reference not set to an instance of an object.

Update here is my stacktrace:

MongoDB.Bson.dll!MongoDB.Bson.Serialization.BsonClassMapSerializer.GetMemberSerializationInfo(string memberName) Line 253 + 0x3 bytes   C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.GetSerializationInfoMember(MongoDB.Bson.Serialization.IBsonSerializer serializer, System.Linq.Expressions.MemberExpression memberExpression) Line 962 + 0xc bytes    C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.GetSerializationInfo(MongoDB.Bson.Serialization.IBsonSerializer serializer, System.Linq.Expressions.Expression expression) Line 888 + 0xf bytes  C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.GetSerializationInfo(System.Linq.Expressions.Expression expression) Line 880 + 0xf bytes C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.BuildComparisonQuery(System.Linq.Expressions.BinaryExpression binaryExpression) Line 433 + 0x1f bytes    C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.BuildQuery(System.Linq.Expressions.Expression expression) Line 768 + 0x37 bytes  C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.BuildQuery() Line 113 + 0xc bytes    C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.SelectQuery.Execute() Line 122 + 0x9 bytes   C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.MongoQueryProvider.Execute(System.Linq.Expressions.Expression expression) Line 147 + 0xb bytes   C#
MongoDB.Driver.dll!MongoDB.Driver.Linq.MongoQueryProvider.Execute<Lion.Tools.Tests.Backends.Entities.Customer>(System.Linq.Expressions.Expression expression) Line 131 + 0xc bytes  C#
[External Code] 
Lion.Tools.Tests.dll!Lion.Tools.Tests.Backends.MongoDbBackendTests.MongoDb_Can_Add_Select_And_Update_Test() Line 79 + 0x27f bytes   C#
[External Code] 

Any idea on what’s going wrong?

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-06-01T22:18:53+00:00Added an answer on June 1, 2026 at 10:18 pm

    There is a bug in the 1.4 version of the C# driver that affects LINQ queries against inherited properties:

    https://jira.mongodb.org/browse/CSHARP-418

    This has been fixed in the master branch and the fix will be in the 1.4.1 release which we plan to release soon.

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

Sidebar

Related Questions

I am currently working on a project with 3 friends using nodeJs, expressJs, MongoDB,
This is the first project by me which is using MongoDB. I have hosted
I'm working on a project myself. I have subversion setup and using tortoisesvn to
I working on project and have problem with threading and update of UI. I
I have updated my jSon object using the code <script type=text/javascript > jQuery(document).ready(function($){ var
I've been trying to get an existing project working on local copy but have
I have been working on a website using MVC Preview 1 since it came
I have just updated my NUnit NuGet reference and my project now appears to
I have a clearcase view which I have not updated in quite some time.
I am using mongodb-engine to access MongoDB from a Django project. Normal get, insert

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.