Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CategoryModel
- {
- public int category_id { get; private set; }
- public string category_title { get; private set; }
- //Constructor
- public CategoryModel(int id, string title)
- {
- category_id = id;
- category_title = title;
- }
- static List<CategoryModel> CategoryList = new List<CategoryModel>();
- public static string GetCategoryName(int categoryNumber)
- {
- IEnumerable<string> title = from c in CategoryList
- where c.category_id.Equals(categoryNumber)
- select c.category_title;
- return title.ToString();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement