- Notifications
You must be signed in to change notification settings - Fork1.6k
Returns: Methods
Genevieve Warren edited this pageOct 3, 2023 ·4 revisions
The following table shows the boilerplate wording for return value descriptions within method topics. The wording varies according to the type that's returned.
Return type | Wording | Examples |
---|---|---|
Task<T> or ValueTask<T> | A task object that, when awaited, produces <XXX>. | Type:Task<String> A task object that, when awaited, produces the response body. |
Class, interface, or structure | <Noun phrase description without specifying the data type. Begin with an introductory article.> Note: If the abstraction is not clear from the context, you can use the wording "An object that identifies/specifies/containsXXX." However, avoid this unless there is no other way to describe the return value. | Type:System.Threading.Thread The new thread. Type:System.IAsyncResult The posted asynchronous request. |
Flag enum | A bitwise combination of the enumeration values <additional information, if necessary>. | Type:System.IO.FileAccess A bitwise combination of the enumeration values. |
Other enum | One of the enumeration values <additional information, if necessary>. | Type:System.Windows.Forms.DialogResult One of the enumeration values that indicates the return value of a dialog box. |
Boolean | true ifXXX; otherwise,false. true ifXXX;false ifXXX. Note: Use the "otherwise" wording unless the second condition must be noted explicitly. Note: The wording for Boolean return values is "true if...," not "true to...." (The wording "true to...." is for parameters.) | Type:System.Boolean true if the specified path refers to a file; otherwise,false. Type:System.Boolean true if the enumerator was successfully advanced to the next element;false if the enumerator has passed the end of the collection. ForShouldSerialize<Property> methods, use this phrasing: Type:System.Boolean true if theInputBindings property value should be serialized; otherwise,false. |
Other primitive or string | <Noun phrase description, without specifying the data type. Begin with an introductory article.> | Type:System.String The string being read. Type:System.Int32 The hash code for the currentSortDescription object. |
Array | An arrayXXX. | Type:System.Reflection.FieldInfo() An array that contains the fields implemented by a type. |