public InterestDL() { Interest x = new Interest(); x.type = "Social Life"; intr.Add(x); x.type = "Medicine"; intr.Add(x); x.type = "Health & Fitness"; intr.Add(x); x.type = "Business"; intr.Add(x); x.type = "Food"; intr.Add(x); x.type = "Studies"; intr.Add(x); x.type = "Freelancing"; intr.Add(x); x.type = "Media Blogs"; intr.Add(x); x.type = "Current Affairs"; intr.Add(x); }
public List <Blog> UserInterestBlog(string user) { List <Blog> Y = new List <Blog>(); Interest gen = new Interest(); foreach (User u in UserDL.users) { if (u.username.ToLower() == user.ToLower()) { foreach (Interest t in u.userGenre) { foreach (Blog b in LL) { gen.type = b.genre; if (t.type == gen.type) { Y.Add(b); } } } } } return(Y); }