Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class BaseCollection<T> : List<T> { ... }
- class PruductCollection : BaseCollection<Product> { ... }
- var products = from p in HugeProductCollection
- where p.Vendor = currentVendor
- select p;
- PruductCollection objVendorProducts = new PruductCollection();
- objVendorProducts.AddRange(products);
- public static class MyExtensions
- {
- public static ProductCollection
- ToProducts( this IEnumerable<Product> collection )
- {
- return new ProductCollection( collection );
- }
- }
- public class ProductCollection : BaseCollection<Product>
- {
- ...
- public ProductCollection( IEnumerable<Product> collection )
- : base( collection )
- {
- }
- ...
- }
- var products = (from p in HugeProductCollection
- where p.Vendor = currentVendor
- select p).ToProducts();
- abstract class BaseCollection<T> : List<T>
- {
- public BaseCollection(IEnumerable<T> collection)
- : base(collection)
- {
- }
- }
- class PruductCollection : BaseCollection<Product>
- {
- public PruductCollection(IEnumerable<Product> collection)
- : base(collection)
- {
- }
- }
- var products = from p in HugeProductCollection
- where p.Vendor = currentVendor
- select p;
- PruductCollection objVendorProducts = new PruductCollection(products);
Add Comment
Please, Sign In to add comment