Question

I need create XML comment for return value of method Login. This method returns object type of Result. This object contains session id if login was successful and if login was unsuccessful contains error message.

I don’t know how decribe this in XML comment.

/// <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;
}

Thank you for advices.

Was it helpful?

Solution

You would use:

/// ...
/// This method returns an object of type <see cref="Result{Account}"/>.
/// ...

See cref Attribute.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top