It seems like this is the case. This is an NHibernate Linq issue, could you
please ask in the NH user list?
-Markus
2009/8/13 scottsingleton <[email protected]>
>
> take the following simple AR entity created on a fresh schema:
>
> [... Initialize AR]
> [...CreateSchema()]
>
> var cus = new Customer { UserName = "TEST"};
> cus.CreateAndFlush();
>
> and the LINQ statement:
>
> using (new SessionScope())
> {
> var custs = from i in ActiveRecordLinq.AsQueryable<Customer>()
> where !String.IsNullOrEmpty(i.UserName)
> select i;
> Assert.Equals(1,custs.Count()); // Failure Expected 1, Actual 0
>
>
> var cust2 = from i in ActiveRecordLinq.AsQueryable<Customer>()
> where i.UserName != null && i.UserName != ""
> select i;
> Assert.Equals(1,cust2.Count()); // Passed: Expected 1, Actual 1
>
> var result1 = Customer.FindAll().ToList().AsQueryable().Where(c => !
> String.IsNullOrEmpty(c.UserName));
> Assert.Equals(1,result1.Count());
> //Passed Comparison works on
> List<Customer>.AsQuerable
> //but defeats LINQ by loading all data into the
> list
>
> var result2 = ActiveRecordLinqBase<Customer>.Queryable.Where(c => !
> String.IsNullOrEmpty(c.UserName));
> Assert.Equals(1,results2.Count());
> //Failure Same query as above just different
> nomenclature
>
> }
>
>
> I know that the the Querable objects are new but is
> String.IsNullOrEmpty not going to be supported for string comparisons?
>
>
>
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---