here is my linq query:
var test = from m in db.Members where m.UserId == null select m.Id;
test.ToList();
UserId is a nullable Guid field on the members table that corresponds to the ASP.NET membership table aspnet_member. I am unable to generate a query through subsonic that will select where the userid IS null, only where it IS NOT null.
here is my expected output:
SELECT Id FROM Member WHERE UserId IS NULL
here is my actual output:
SELECT Id FROM Member WHERE UserId IS **NOT** NULL
Any thoughts? I am in the processes of debugging but maybe someone else has run into this.
Turns out there was no implementation for ExpressionType.Equals in the VisitBinary method. There was recently a patch that can be found here:
[http://github.com/subsonic/SubSonic-3.0/blob/master/SubSonic.Core/Linq/Structure/TSqlFormatter.cs%5D%5B1%5D
The old code was:
The implementation has been added for Equal. Is is pretty much identical to NotEqual except emits IS NULL instead of IS NOT NULL.