473,473 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Filtering a Custom Collection of business Objects - C#

I have a base collection class that I use to derive all my collections
from. It derives from CollectionBase. I have added custom Sorting and
now would like to add Filtering.

I have spent a decent amount of time looking thru code and really have
not found anything that suits my needs. I simply want to pass in a
filter expression use that that expression against the protected List
(exposed by CollectionBase) object and return an array list containing
only the objects that meet that filter expression.

Is this possible? OR Shall I just do forEach and check the props of
the objects I have stored in the Collection?

Any help would be great.

Erik
Nov 13 '05 #1
1 7147
Hi Erik

I have created a set of classes for this, it's very easy using reflection.
Just give me a few hours to prepare you a document with the code and an
explanation of how to use it.

You use reflection, and you pass the property/method name you will filter
by and it does not require any modification in the classes being filtered .

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Erik" <Ri************@yahoo.com> wrote in message
news:16**************************@posting.google.c om...
I have a base collection class that I use to derive all my collections
from. It derives from CollectionBase. I have added custom Sorting and
now would like to add Filtering.

I have spent a decent amount of time looking thru code and really have
not found anything that suits my needs. I simply want to pass in a
filter expression use that that expression against the protected List
(exposed by CollectionBase) object and return an array list containing
only the objects that meet that filter expression.

Is this possible? OR Shall I just do forEach and check the props of
the objects I have stored in the Collection?

Any help would be great.

Erik

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: GrumpyDev | last post by:
what is the best way to implement collection of custom entities?
1
by: womber | last post by:
I am getting XML from a dataset that has been populated via a storedprocedure no schemas have been applied nor any relationships. But the correct table names have been given to match the table(s)...
0
by: Michael Rodriguez | last post by:
I have a custom business object collection based on the CSLA.NET framework from Rockfor Lhotka's "Expert C# Business Objects" book. I bound my winform to the object and when I open the screen the...
3
by: Shawn Ramirez | last post by:
As with most web applications speed is a huge deal to me in my applications. My customers don't really care if my app is a true 3 tier application or not, they just want it to be faster then it was...
10
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to...
3
by: =?Utf-8?B?R2hpc3Rvcw==?= | last post by:
Hi all, We have a N-Tier framework and we now create a Web Site App to wotk with this architecture. I add reference from my libraries in the project and creating page and controls is very...
5
by: Simon Woods | last post by:
Hi Does anyone know if there any dotnet software out there which converts a dataset into a collection of custom objects, programmatically i.e. actually creates the class structure and collection...
3
by: Krish | last post by:
Hi All, I have a component that reads a file and returns the data as a an array of objects. Now I want to add the capability of filtering on this. This means if an array of objects is returned...
1
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
I'm running VS2008 & attempting to solve a problem I've encountered while developing some software for our business. Here's the basic idea...I've created a class that represents a file (with...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.