Tuesday, November 13, 2007

Overriding Index of a Generic List

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace Application.DomainModel.Collections
{
    public class Couriers<Courier> : List<Courier>
    {
        public Courier this[string courierCode]
        {
            get
            {
                return this.Find(delegate(Courier courier)
                { return (string.Compare(courier.CourierCode, courierCode) == 0); });
            }
        }
    }
    public class Courier
    {
        public string CourierCode { getset; }
    }
}

No comments:

Azure Storage Account Types

Defferent Types of Blobs Block blobs store text and binary data. Block blobs are made up of blocks of data that can be managed individually...