


.png)

.png)

.png)

< dependentAssembly>
< assemblyIdentity name = "System.Web.WebPages.Razor " publicKeyToken =" 31bf3856ad364e35 "/>
< bindingRedirect oldVersion = "1.0.0.0-3.0.0.0 " newVersion =" 3.0.0.0 "/>
</ dependentAssembly >
在项目Areas 文件夹下就自动生成了有关帮助页的所有代码文件



// Uncomment the following to use the documentation from XML documentation file. config.SetDocumentationProvider( new XmlDocumentationProvider ( HttpContext.Current.Server.MapPath( "~/App_Data/XmlDocument.xml" )));

/// <summary> /// 查询指定ID的商品信息 /// </summary> /// <param name="id"> 商品ID </param> /// <returns> 查询到的商品记录 </returns> [ HttpGet] public Product Get( int id) { return repository.Products.FirstOrDefault(p => p.ProductId == id); }

/// <summary> /// 获取商品列表 /// </summary> /// <returns> 商品列表 </returns> [ ApiExplorerSettings(IgnoreApi = true )] public IEnumerable < Product> Get() { return repository.Products; }

原文:http://www.cnblogs.com/daretodream2014/p/4316756.html