Remove property from a list
NorthwindDataContext db = new NorthwindDataContext();
List<CategorySml> oList = new List<CategorySml>();
oList = db.Categories.Select(p => new CategorySml { CategoryID = p.CategoryID, CategoryName = p.CategoryName }).ToList();
class CategorySml
{
public int CategoryID { get; set; }
public string CategoryName { get; set; }
}
My list contain more than 100 rows,Now i want to remove CategoryID property from my list oList .I know how to remove item from a list bellow syntax can do that,but i don't know how to remove property's of a item
oList.RemoveAll(x => x.CategoryID== 1);
Help me to remove property from a list.Thanks in advance.