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.

About Me
My Photo

Full Stack Developer,Blogger,Microsoft Mvp, Mentor, Life long learner, 10+ Years of Experience for JavaScript, web and Microsoft technologies. ASP.NET MVC,Web Forms,C#,AngularJs,Golang
Mvp profile
Subscribe to my blog

Enter your email address:

Follow us on facebook
Blog Archive
Total Pageviews