-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.4.2, 1.5
-
Component/s: None
Consider this example, where Concrete represents a collection and happens to derive from Abstract, which is an abstract base class.
IQueryable<Concrete> concretes = collection.AsQueryable();
IQueryable<Abstract> abstracts = concretes;
var queryResults = abstracts.Where(...).ToList(); // results in MissingMethodException
System.MissingMethodException: Constructor on type 'MongoDB.Driver.Linq.Projector2[[[MongoDB.Bson.ObjectId, MongoDB.Bson, Version=1.5.0.26036, Culture=neutral, PublicKeyToken=f686731cfb9cc103]]' not found. at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) at MongoDB.Driver.Linq.SelectQuery.Execute() at MongoDB.Driver.Linq.MongoQueryable1.GetEnumerator()
Note – this used to work perfectly in Fluent mongo.