Monday, July 9, 2007

C#.NET 2.0 Generics Class collection

C#.NET 2.0 provide great features with generics collection. Now you don't have to write code for the coding for adding,removing objects. It all contains by the generics colleciton. here the sample user level class

using System;
using System.Collections.Generic;




public class UserLevelCollection
:System.Collections.Generic.List<userlevelcollection>

{
#region Private Members
private int _intUserLevelID;
private Guid _guidUserLevelGUID;
private string _strDescription;
private int _intCreatedBy;
private DateTime _dtCreatedDate;
private int _intLastModifiedBy;
private DateTime _dtLastModifiedDate;
#endregion
#region Public Properties
public int UserLevelId
{
get { return _intUserLevelID;}
set { _intUserLevelID = value; }
}
public Guid UserLevelGUID
{
get { return _guidUserLevelGUID; }
set {_guidUserLevelGUID=value; }
}
public string Description
{
get { return _strDescription;}
set { _strDescription = value; }
}
public int CreatedBy
{
get { return _intCreatedBy; }
set { _intCreatedBy = value; }
}
public DateTime CreatedDate
{
get { return _dtCreatedDate; }
set { _dtCreatedDate = value; }
}
public int LastModifiedBy
{
get { return _intLastModifiedBy; }
set { _intLastModifiedBy = value; }
}
public DateTime LastModifiedDate
{
get { return _dtLastModifiedDate;}
set { _dtLastModifiedDate = value; }
}
#endregion

}
}
Share:

0 comments:

Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews