OpenApiDocument.AddComponent<T>(String, T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a component to the components object of the current document and registers it to the underlying workspace.
public bool AddComponent<T>(string id, T componentToRegister);
member this.AddComponent : string * 'T -> bool
Public Function AddComponent(Of T) (id As String, componentToRegister As T) As Boolean
Type Parameters
- T
The type of the component
Parameters
- id
- String
The id for the component
- componentToRegister
- T
The component to add
Returns
Whether the component was added to the components.
Exceptions
Thrown when the component is null.
Thrown when the id is null or empty.