Persistence Layer and Business Objects for Microsoft .NET

Support Forums

 
ForumForumEntitySpaces AP...EntitySpaces AP...LINQLINQLinq questionLinq question
Previous Previous
 
Next Next
New Post
 8/17/2010 3:31 PM
 

Hi,

I'm having trouble converting this statement to vb.net:

coll.Filter = coll.AsQueryable().Where(d => d.FirstName == null);

Any suggestions?

Steve

New Post
 8/17/2010 3:39 PM
 

It would look something like this:

coll.Filter = coll.AsQueryable().Where(Function(d) d.FirstName Is Nothing)


| BLOG
New Post
 8/17/2010 4:12 PM
 

Hi,

Thank you for the quick response. I'm getting a Runtime error with this code:

Collection.AsQueryable().Where(Function(d) d.FirstName Is Nothing)

Warning 2 Runtime errors might occur when converting 'String' to 'System.Linq.IQueryable(Of iLearn.BusinessObjects.CategorySub)'.

Steve

New Post
 8/17/2010 4:16 PM
 

Mike,

My mistake, it works fine.

Thank you. Steve

New Post
 8/17/2010 4:52 PM
 

How do you reset a filter in ES2010? I changed my filter to:

  routes.Filter = routes.AsQueryable().Where(Function(d) d.AirClicRoute = deliverable.RouteName.ToString.ToUpper)

I now want to remove the Filter

New Post
 8/17/2010 6:12 PM
 

Just assign it to null or Nothing ... (This is covered in the Release Notes.PDF I think too)


| BLOG
New Post
 8/18/2010 9:21 AM
 

Thanx.

fyi..

DevExpress shows an issue on the Filter word in this statement

 routes.Filter = routes.AsQueryable().Where(Function(d) d.AirClicRoute = routeToCheck)

Clicking the link to Declare Property (with backing store) goes here:

New Post
 8/18/2010 9:27 AM
 

I'm totally confused, why would DevX be talking to our filter property?


| BLOG
New Post
 8/18/2010 12:31 PM
 
Mike.Griffin wrote:

I'm totally confused, why would DevX be talking to our filter property?

Mike, CodeRush/Refactor Pro has made some real improvements. One of them is its ability to follow/trace code througout your solution and make meaningful "suggestions" or highlight potential maintenance issues. That error indicates that CR/R! cannot find within the chain the implementation and is suggesting that the code might err if the memeber is called. Sometimes CR/R! does not have access to the entire chain and its warning is false (I.e. a seperate assembly not referenced).

There are many other helpful features and when I look at the output of generated files with it there are many not-so-big-deal suggestions like the "this." portion of code is redundant and not needed, or when using .NET 3.5 and above you can just call a delegate directly (I.e. the method).

There are also suggestions that could potentially help with memory usage and performance. For example, several methods are being identified as "could make member static". That could save memory and with high volumes improve performance.

Anyway, its been beyond useful for me and it does a very nice job of looking for potential errors or areas of potential improvement.

New Post
 8/18/2010 12:50 PM
 

Telerik also has a similar product called JustCode that provides similar functions.

http://www.telerik.com/products/justc...

Previous Previous
 
Next Next
ForumForumEntitySpaces AP...EntitySpaces AP...LINQLINQLinq questionLinq question