List of. NET

Source: Internet
Author: User

There are three classes, consider:

Find the tag and reply for all posts in a relatively superior way:

Class post{public int ID {get; set;}    public int TagId {get; set;} public int Replyid {get; set;}}    Class tag{public int ID {get; set;} public string Name {get; set;}}    Class reply{public int ID {get; set;} public string Name {get; set;}}

In order to facilitate the description, then a given three list<t>:

list<post> postlist = new list<post> (); list<tag> tagList = new list<tag> (); list<reply> replylist = new list<reply> ();

Ideas:

1: Facilitate taglist and replylist respectively and convert to dictionary

2: Convenient postlist, and according to the ID to obtain the corresponding information

Principle:

Fully leverages the concept of the index (dictionary for the Keyvaluepars list)

This article is from the "lybing" blog, make sure to keep this source http://lybing.blog.51cto.com/3286625/1790134

List of. NET

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.