我需要为方法登录的返回值创建 XML 注释。此方法返回 Result 的对象类型。如果登录成功,则此对象包含会话 ID,如果登录不成功则包含错误消息。
我不知道如何在 XML 注释中描述这一点。
/// <summary>
/// Login to server
/// </summary>
/// <param name="name">Name of user</param>
/// <param name="password">User password</param>
/// <returns>
/// This method return object type of Result<Account>
/// If login was successful contains sessions
/// If login was unsuccessful contains error
/// </returns>
Result<Account> Login(string name, string password);
/// <summary>
/// Return value of method
/// </summary>
/// <typeparam name="T">Type of return value</typeparam>
public class Result<T>
{
/// <summary>
/// Return message
/// </summary>
public string ResultMessage { get; set; }
/// <summary>
/// Return value
/// </summary>
public T ReturnValue { get; set; }
}
public class Account
{
public string Name{get;set;}
public string Password {get;set;}
public string Session {get;set;
}
谢谢你的建议。