This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
This question is similar to one that Joe asked previously. I'm using Lightspeed with Linq in C#3.5 while connecting to simpleDB
Say I have a domain with a nullable field. If an Iqueryably is created such as:
var queryable = Context.Enttity; queryable = queryable.OrderBy(e => e.SomeNullableField); var count = queryable.Count(); //gets the current *page* of entities queryable = queryable .Skip((page - 1) * rowsPerPage).Take(rowsPerPage); return queryable.ToList();
What I find is that the count still represents the entire set (of Context.Entity) but once the OrderBy is performed, Only those that have a value in the nullable field are returned with the set.
If the skip is performed on a later page (which should result in only those that are null in the nullable field) i get the following error:
System.Reflection.TargetInvocationException was unhandled by user code Message="Exception has been thrown by the target of an invocation." Source="mscorlib" StackTrace: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Mindscape.LightSpeed.Linq.ProjectionStrategy.ExecuteEntityQuery(Query query, IUnitOfWork unitOfWork) at Mindscape.LightSpeed.Linq.ProjectionStrategy.Execute(Query query, IUnitOfWork unitOfWork) at Mindscape.LightSpeed.Linq.LinqQueryExecutionPlan.Execute() at Mindscape.LightSpeed.Linq.LinqQueryTranslator.Translate(Expression expression, IUnitOfWork unitOfWork, String viewName) at Mindscape.LightSpeed.Linq.LinqQueryProvider.Execute(Expression expression) at Mindscape.LightSpeed.Linq.LinqQueryProvider.System.Linq.IQueryProvider.Execute(Expression expression) at Mindscape.LightSpeed.Linq.LinqQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
|
|