Print Page | Close Window

Fatal error in 6.0.7

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=2370
Printed Date: 06-Jun-2025 at 12:35pm


Topic: Fatal error in 6.0.7
Posted By: jocker1331
Subject: Fatal error in 6.0.7
Date Posted: 11-Dec-2010 at 5:41am
Please make patch for v6.0.7 ....

NullRefException in
   в IdeaBlade.Linq.PredicateBuilder.FilterQuery(IQueryable baseQuery, IPredicateDescription predicateDescription)
   в IdeaBlade.Windows.ObjectDataSource.GetFilteredQuery()
   в IdeaBlade.Windows.ObjectDataSource.LoadView()
   в IdeaBlade.Windows.ObjectDataSource.LoadCore()
   в IdeaBlade.Windows.ObjectDataSource.Load()
   в CivilizationWeb.Views.TaskList.OnNavigatedTo(NavigationEventArgs e)
   в System.Windows.Controls.Page.InternalOnNavigatedTo(NavigationEventArgs e)
   в System.Windows.Navigation.NavigationService.RaiseNavigated(Object content, Uri uri, Page existingContentPage, Page newContentPage)
   в System.Windows.Navigation.NavigationService.CompleteNavigation(DependencyObject content)
   в System.Windows.Navigation.NavigationService.ContentLoader_BeginLoad_Callback(IAsyncResult result)

//If you use DomainDatasource without filters.

See comments in code (Reflected):

//souce:IdeaBlade.Linq.PredicateBuilder
public static IQueryable FilterQuery(IQueryable baseQuery, IPredicateDescription predicateDescription)
{
    Type genericArgument = TypeFns.GetGenericArgument(baseQuery.GetType());
    Expression expression = Expression.Call(typeof(Queryable), "Where", new Type[] { genericArgument }, new Expression[] { Expression.Constant(baseQuery), predicateDescription.ToLambdaExpression() }); //predicateDescription _CAN_ be null
    return baseQuery.Provider.CreateQuery(expression);
}

// source: IdeaBlade.Windows.ObjectDataSource
private IPredicateDescription GetQueryFilter()
{
    try
    {
        List<PredicateDescription> list = new List<PredicateDescription>();
        foreach (FilterDescriptor descriptor in this.FilterDescriptors)
        {
            PredicateDescription item = descriptor.ToPredicateDescription(this.Query.ElementType);
            if (item != null)
            {
                list.Add(item);
            }
        }
        if (list.Count > 0)
        {
            return PredicateBuilder.And(list.ToArray());
        }
        return null; ///!!!!
    }
    catch (Exception exception)
    {
        TraceFns.WriteLine("Filters ignored: " + exception.Message);
        return null;
    }
}

 






Replies:
Posted By: kimj
Date Posted: 13-Dec-2010 at 9:42am
Sorry you've run into this problem.  You'll only get this error if using the ObjectDataSource with a PageSize of 0.  This indicates that paging is not wanted and the underlying view used is the SL PagedCollectionView instead of the DevForce EntityQueryPagedCollectionView. 
 
The workaround until the problem is fixed is to either turn on paging by setting a non-zero PageSize, or to add a dummy FilterDescriptor.   



Print Page | Close Window