Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. class CategoryModel
  2. {
  3. public int category_id { get; private set; }
  4. public string category_title { get; private set; }
  5.  
  6. //Constructor
  7. public CategoryModel(int id, string title)
  8. {
  9. category_id = id;
  10. category_title = title;
  11. }
  12.  
  13. static List<CategoryModel> CategoryList = new List<CategoryModel>();
  14.  
  15. public static string GetCategoryName(int categoryNumber)
  16. {
  17. IEnumerable<string> title = from c in CategoryList
  18. where c.category_id.Equals(categoryNumber)
  19. select c.category_title;
  20. return title.ToString();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement