Home >php教程 >php手册 >Use of var

Use of var

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-06 13:30:281419browse

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).


Statement:
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