Home > php教程 > php手册 > body text

Use of var

WBOY
Release: 2016-07-06 13:30:28
Original
1365 people have browsed it

ListEnterPRise epList = ViewBag.epList; foreach (var item in epList){ //todo ... } When ListEnterprise epList = ViewBag.epList; becomes ListEnterpriseInfo epList = ViewBag.epList;, the following foreach statement is not used at all Change will speed up the encoding. That is, you can simply

List epList = ViewBag.epList;

foreach (var item in epList){

//todo...

}

When List epList = ViewBag.epList; becomes List epList = ViewBag.epList;,

The following foreach statement does not need to be changed at all, which will speed up coding. In other words, it can be simply understood that var is a type variable (essentially type inference).


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!