1
votes

I'm working with my data via WCF RIA Services. I expose my data via RIA queries and it's works fine. Now I need to get parameterized query method. I've added parameter to query method on server side:

public IQueryable<User> GetUsers(string param1)
{
    return _dataContext.Users;
}

.. and pass param value on a client:

var query = _context.GetUsersQuery("a");
_context.Load(query, LoadBehavior.MergeIntoCurrent,
                            (LoadOperation lo) =>
                            {
                                if (lo.HasError == false)
                                {
                                    ResultList.ItemsSource = lo.Entities;
                                }

                            }, null);

As a result I receive NullReferenceExeption on the client when I try to get data. Is it a know bug of WCF RIA Services or I missed something?

1
Where exactly is the NullReference occuring? Which line? Maybe check the result of _dataContext.Users before it's sent back up to the client. You aren't doing anything obviously wrong. - Alastair Pitts

1 Answers

0
votes

It looks like it's the ResultList that is null - make sure it is initialised before you run the query