为了创建API
方法的帮助页面,xml documetation已被用作此Creating Help Pages for ASP.NET Web API和ASP.Net WebApi Help Page所描述的内容。我的api's
签名之一是这样的:
/// <summary>
/// this is getting a place's information
/// </summary>
/// <param name="placeKey">Unique key of place</param>
/// <param name="checkIn">Checkin date </param>
/// <param name="checkOut">CheckOut date </param>
/// <returns>
/// Place's Information
/// </returns>
Core.Services.APIViewModels.PlacesViewModel GetPlaceInformation(string categoryKey, string placeKey, string checkIn , string checkOut)
xml文档是正确的,除了我们需要记录PlacesViewModel
返回类型。实际上PlacesViewModel
是解决方案中另一个项目的视图模型。已经为此提供了xml评论:
/// <summary>
/// a place information.</summary>
public class PlacesViewModel
{
/// <summary>
///unique number of place</summary>
public long PlaceId { get; set; }
/// <summary>
/// place's name</summary>
public string PlaceName { get; set; }
/// <summary>
/// places's key</summary>
public string Key { get; set; }
}
但是它不起作用,PlacesViewModel
类参加了PlacesViewModel
表格中描述列的空值帮助页面,就好像它们没有xml注释一样。为什么可以提供PlacesViewModel
如果PlacesViewModel
转移到同一个项目,它将运作良好!