Issue 162 in dblinq2007: NullReferenceException in ExpressionDispatcher.AnalyzeQueryProvider when using array or list as IQueryable

1 view
Skip to first unread message

codesite...@google.com

unread,
Oct 21, 2009, 12:21:20 AM10/21/09
to dblin...@googlegroups.com
Status: New
Owner: ----

New issue 162 by emp....@gmail.com: NullReferenceException in
ExpressionDispatcher.AnalyzeQueryProvider when using array or list as
IQueryable
http://code.google.com/p/dblinq2007/issues/detail?id=162

What steps will reproduce the problem?
1. Create a Postgres DbLinq object.
2. Create a string array or list and use it as an IQueryable.
3. Run a LINQ query that calls Contains() on the above array.

Sample code:

// This works fine:
//var stringArray = new[] { "one", "two" };
// This fails:
var stringArray = new[] {"one", "two"}.AsQueryable();

var result =
from l in db.lookupcodes
where stringArray.Contains(l.lookupcode1)
select l.lookupcode1;


What is the expected output? What do you see instead?

Expected: results should be returned, same as when the array is used as an
IEnumerable. Actual: NullReferenceException is thrown (see exception.txt)

What version of the product are you using? On what operating system?

SVN revision 1239 on .NET 3.5 SP1, Windows XP Pro x64 SP2


Attachments:
exception.txt 5.9 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

dblin...@googlecode.com

unread,
Jan 21, 2010, 6:02:02 PM1/21/10
to dblin...@googlegroups.com
Updates:
Status: Accepted
Labels: Type-Defect Component-DbLinq Priority-Medium

Comment #1 on issue 162 by jonmpryor: NullReferenceException in

ExpressionDispatcher.AnalyzeQueryProvider when using array or list as
IQueryable
http://code.google.com/p/dblinq2007/issues/detail?id=162

Still present:

var db = CreateDB();
var stringArray = new[] { "Nancy", "Laura" }.AsQueryable();
var q = from e in db.Employees
where stringArray.Contains(e.FirstName)
select e.FirstName;
foreach (var e in q)
Console.WriteLine(e);

dblin...@googlecode.com

unread,
Apr 1, 2012, 10:54:25 AM4/1/12
to dblin...@googlegroups.com

Comment #2 on issue 162 by tos.oliv...@gmail.com: NullReferenceException in
ExpressionDispatcher.AnalyzeQueryProvider when using array or list as
IQueryable
http://code.google.com/p/dblinq2007/issues/detail?id=162

Try with this patch:
http://code.google.com/p/dblinq2007/issues/detail?id=132#c2

Reply all
Reply to author
Forward
0 new messages