Conversion from a non-generic list to a generic list

Source: Internet
Author: User
The night is long and you have no desire to sleep.

I am writing a paragraph Code , Using nhib.pdf to read a group of data from the database. I used generic ilist for the first time. it feels good, but there is a slight problem, because the current nhib1_1.0.2 does not support generics. all data obtained from criteria must be translated once before it can be returned to ilist <t>.
The code I wrote is as follows: Ilist list = Criteria. List ();
List < Tagpostmapping > Results =   New List < Tagpostmapping > ();
Foreach ( Object OBJ In List)
{
Results. Add (tagpostmapping) OBJ );
}
Return Results;

As a matter of fact, Ms should also provide a corresponding solution. After all, this translation also adds a lot of junk code.
We also hope that nhib.pdf will feel the new version and support generics directly, which makes it much easier.

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.