JsonSchema.Net.Generation Adds attribute-related schema elements. Adds a handler for a custom attribute that cannot be made to implement . The handler type. Adds a handler for a custom attribute that cannot be made to implement . The handler. Removes a handler type. The handler type. Applies an `additionalProperties` keyword. If the attribute value represents a boolean schema, gets the boolean value. If the attribute value represents a type schema, gets the type. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. A boolean schema. Creates a new instance. A type to generate a schema for the keyword. Applies an `additionalProperties` keyword. If the attribute value represents a boolean schema, gets the boolean value. If the attribute value represents a type schema, gets the type. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. A boolean schema. Creates a new instance. A type to generate the a schema for the keyword. Serves as a base class for attributes which support conditional schema generation. Identifies the condition group under which this attribute applies. Applies a `const` keyword. The value. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Applies a `default` keyword. The value. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Creates a new instance. The value. Applies a `description` keyword. The description. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies an `exclusiveMaximum` keyword. The `value` parameter is provided in the constructor as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. The exclusive maximum. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. The parameter is provided as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. Applies an `exclusiveMinimum` keyword. The `value` parameter is provided in the constructor as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. The exclusive minimum. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. The parameter is provided as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. Applies an `$id` keyword. The regular expression pattern. Creates a new instance. The value. Creates or amends a condition group by expecting a value in a property. The property name. The expected property value. The compiler will allow any compile-time constant, however only JSON-compatible values will work. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates a new instance. The name of the property. The expected value for the property. The condition group. Creates multiple condition groups based on the value of an enum property, one group for each defined enum value. The enum type is inferred from the property. The property name. Gets or sets whether to use numbers or names in the condition. Default is to use names. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The property name. (optional) Whether to use numbers or names in the condition. Default is to use names. Creates or amends a condition group by defining an expected maximum value in a property. The specific keywords which are added depend on the type of the targeted property. The property name. The expected maximum value. Gets or sets whether the value should be exclusive. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The name of the property. The expected maximum value for the property. The condition group. The parameter is provided as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted when applied as the `maximum` or `exclusiveMaximum` keywords. Creates or amends a condition group by defining an expected minimum value in a property. The specific keywords which are added depend on the type of the targeted property. The property name. The expected minimum value. Gets or sets whether the value should be exclusive. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The name of the property. The expected minimum value for the property. The condition group. The parameter is provided as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted when applied as the `minimum` or `exclusiveMinimum` keywords. Indicates an attribute can support being applied to generic parameters. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Default MUST be -1, which indicates the root type. For example, `Person` in `Dictionary<string, Person>` would have a parameter of 1. Indicates that the property should be excluded from generation. This attribute functions exactly the same as the . It is included separately to support the case where the model should be serialized with a property or enum member but schema generation should ignore it. Initializes a new instance of . Handler for the . Processes the type and any attributes (present on the context), and adds intents to the context. The generation context. Applies a `maximum` keyword. The `value` parameter is provided in the constructor as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. The maximum. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. The parameter is provided as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. Applies an `maxItems` keyword. The maximum number of items. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `maxLength` keyword. The maximum length. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `minimum` keyword. The `value` parameter is provided in the constructor as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. The minimum. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. The parameter is provided as a `double` but stored as a `decimal` because `decimal` is not a valid attribute parameter type. As such, to prevent overflows, the value is clamped to the `decimal` range prior to being converted. Applies a `minItems` keyword. The minimum number of items. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `minimum` keyword. The minimum length. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `multipleOf` keyword. The divisor. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Overrides the nullability declared in code and either adds or removes `null` in the `type` keyword. Gets whether `null` should be included in the `type` keyword. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. Whether `null` should be included in the `type` keyword. Applies a `pattern` keyword. The regular expression pattern. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `readOnly` keyword. Whether the property should be read-only. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance with a value of `true`. Creates a new instance. The value. Indicates a property is required and should be listed in the `required` keyword. Applies a `title` keyword. The title. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `uniqueItems` keyword. Whether the items should be unique. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance. The value. Applies a `writeOnly` keyword. Whether the property should be write-only. The index of the parameter to which the attribute should apply. Default is -1 to indicate the root. Creates a new instance with a value of `true`. Creates a new instance. The value. Extension methods for context objects. Gets the attribute set. Type contexts get type attributes; member context get member attributes. The context. The attribute set. Thrown for other context types. Tracks the available generators. Registers a new generator. The generator. Registration is order dependent: last one wins. If you have multiple generators which can handle a given type, the last one registered will be used. Defines a generator. Generators are the first stage of schema generation. These will add keyword intents to the context, which then are translated into keywords after optimization. Implementations MUST also override Determines whether the generator can be used to generate a schema for this type. The type. `true` if the generator can be used; `false` otherwise. Processes the type and any attributes (present on the context), and adds intents to the context. The generation context. Defines requirements to handle converting an attribute to a keyword intent. Processes the type and any attributes (present on the context), and adds intents to the context. The generation context. The attribute. A common pattern is to implement on the attribute itself. In this case, the parameter will be the same instance as the handler and can likely be ignored. Processes attributes of type that are present on a type or member and adds intents to the context. The type of the attribute that is handled. Provides intent to create an `additionalItems` keyword. The context that represents the inner requirements. Creates a new instance. The context. Applies the keyword to the . The builder. Provides intent to create an `additionalProperties` keyword. The context that represents the inner requirements. Creates a new instance. The context. Applies the keyword to the . The builder. Provides intent to create a `allOf` keyword. Gets the subschemas to include. Creates a new instance of the class. The subschemas to include. Creates a new instance of the class. The subschemas to include. Applies the keyword to the . The builder. Provides intent to create a `anyOf` keyword. Gets the subschemas to include. Creates a new instance of the class. The subschemas to include. Creates a new instance of the class. The subschemas to include. Applies the keyword to the . The builder. Provides intent to create a `const` keyword. The expected value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `default` keyword. The expected value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `$defs` keyword. The contexts that represent the definitions. Creates a new instance. The contexts. Applies the keyword to the . The builder. Provides intent to create a `deprecated` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `description` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create an `else` keyword. A set of intents used to define the subschema. Creates a new instance. Applies the keyword to the . The builder. Provides intent to create an `enum` keyword. The names defined by the enumeration. Creates a new instance. The names defined by the enumeration. Creates a new instance. The names defined by the enumeration. Creates a new instance. The values defined by the enumeration. Creates a new instance. The values defined by the enumeration. Applies the keyword to the . The builder. Provides intent to create an `exclusiveMaximum` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create an `exclusiveMinimum` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `format` keyword. The format. Creates a new instance. The format. Applies the keyword to the . The builder. Provides intent to create an `$id` keyword. The URI to use as the schema's ID. Creates a new instance. Applies the keyword to the . The builder. Provides intent to create an `if` keyword. A set of intents used to define the subschema. Creates a new instance. Applies the keyword to the . The builder. Provides intent to create an `items` keyword. The context that represents the inner requirements. Creates a new instance. The context. Applies the keyword to the . The builder. Provides intent to create a `maximum` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `maxItems` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `maxLength` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `maxProperties` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `minimum` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `minItems` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `minLength` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `minProperties` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `multipleOf` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create an `if` keyword. A set of intents used to define the subschema. Creates a new instance. Applies the keyword to the . The builder. Provides intent to create a `pattern` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create an `additionalProperties` keyword. The contexts that represent the properties. Creates a new instance. The contexts. Applies the keyword to the . The builder. Provides intent to create a `propertyNames` keyword. The context that represents the inner requirements. Creates a new instance. The context. Applies the keyword to the . The builder. Provides intent to create a `readOnly` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `$ref` keyword. The reference. Creates a new instance. The reference. Creates a new instance. The context that holds this reference. The reference. Applies the keyword to the . The builder. Provides intent to create a `required` keyword. The required property names. Creates a new instance. The required property names. Applies the keyword to the . The builder. Provides intent to create a `then` keyword. A set of intents used to define the subschema. Creates a new instance. Applies the keyword to the . The builder. Provides intent to create a `title` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `type` keyword. The type. Creates a new instance. The type. Applies the keyword to the . The builder. Provides intent to create an `unevaluatedProperties` keyword. The context that represents the inner requirements. Creates a new instance. The context, or null to apply the false schema. Applies the keyword to the . The builder. Provides intent to create a `uniqueItems` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Provides intent to create a `writeOnly` keyword. The value. Creates a new instance. The value. Applies the keyword to the . The builder. Describes the intent to create a keyword. Because is immutable, the system cannot generate the schema directly as it needs to do some optimization first. Keyword intents allow this. They record all of the data needed by the keyword. Application involves translating the intent into an actual keyword on the using one of the fluent extension methods provided by . Custom intents will need to be applied from within custom implementations. Implementations MUST also override Applies the keyword to the . The builder. Describes a schema generation refiner. Refiners run after attributes have been processed, before the schema itself is created. This is used to add customization logic. Determines if the refiner should run. Runs the refiner. Allows custom `$defs` key naming functionality. Generates a `$defs` key for a type. The type. A string to use for the type; null to use the library-provided behavior. Provides extension methods for schema generation. Generates a schema from a CLR type. The type to generate. The schema builder. The generator configuration. The schema builder (for fluent syntax support). Generates a schema from a CLR type. The schema builder. The type to generate. The generator configuration. The schema builder (for fluent syntax support). Provides context for object members to include those attributes. The type. Gets the context this is based on. Gets the set of member attributes. Indicates whether the member is marked as a nullable reference type. Gets or sets the generic parameter that this context represents. A null value (default) represents the root type. Declares a property name resolution which is used to provide a property name. The property. The property name Defines a set of predefined property name resolution methods. Makes no changes. Properties are generated with the name of the property in code. Property names to camel case (e.g. `camelCase`). Property names to pascal case (e.g. `PascalCase`). Property names to snake case (e.g. `Snake_Case`). Property names to lower snake case (e.g. `lower_snake_case`). Property names to upper snake case (e.g. `UPPER_SNAKE_CASE`). Property names to kebab case (e.g. `Kebab-Case`). Property names to upper kebab case (e.g. `UPPER-KEBAB-CASE`). Indicates the sequence in which properties will be listed in the schema. Properties will be listed in the order they're declared in code. Properties will be sorted by name, case-insensitive. Provides base functionality and data for generation contexts. Represents a true schema. Represents a false schema. The type. The keyword intents required for this type. Applies the keyword to the . The schema builder. The schema builder (for fluent syntax support). Gets the contexts for the current run. Gets or creates a based on the given type and attribute set. The type to generate. A generation context, from the cache if one exists with the specified type and attribute set; otherwise a new one. New contexts are automatically cached. Use this in your generator if it needs to create keywords with subschemas. Provides additional configuration for the generator. Thread-static storage of the current configuration. Only to be used for reading the configuration. Setting values on this object will be overwritten when starting generation. A collection of refiners. A collection of generators in addition to the global set. Gets or sets the order in which properties will be listed in the schema. Gets or sets the property name resolving method. Default is . This can be replaced with any `Func<MemberInfo, string>`. Gets or sets whether properties that are affected by conditionals are defined globally or only within their respective `then` subschemas. True restricts those property definitions to `then` subschemas and adds a top-level `unevaluatedProperties: false`; false (default) defines them globally. Allows mapping of types to external schema `$id`s. When encountering one of these types, a `$ref` keyword will be generated instead of a full schema. Provides custom naming functionality. Creates a new . Registers an assembly's XML comment file. Any type in the assembly. The file name of the XML file. Provides informative methods for types. Determines whether the type is a simple, one-dimensional, non-keyed collection. The type. true if the type represents an array; false otherwise. Determines if the type is a nullable value type, i.e. . The type True if the type is ; false otherwise. Determines if the type is a nullable value type, i.e. . The type True if the type is ; false otherwise. Provides a context for generating schemas for types. The type. The number of times this context has been referenced. Base class for comments classes "summary" comment "remarks" comment "example" comment Helper class that reads XML documentation generated by C# compiler from code comments. Dictionary of XML navigators for multiple assemblies. Function that returns path to XML documentation file for specified assembly. Default value is true. When it is set to true DocXmlReader removes leading spaces and an empty lines at the end of the comment. By default XML comments are indented for human readability but it adds leading spaces that are not present in source code. For example here is compiler generated XML documentation with '-' showing spaces for readability. ---- ----Text ---- With UnIndentText set to true returned summary text is just "Text" With UnIndentText set to false returned summary text contains leading spaces and the trailing empty line "\n----Text\n----" Open XML documentation files based on assemblies of types. Comment file names are generated based on assembly names by replacing assembly location with .xml. Function that returns path to the assembly XML comment file. If function is null then comments file is assumed to have the same file name as assembly. If function returns null or if comments file does not exist then all comments for types from that assembly would remain empty. Returns comments for the class method. May return null object is comments for method are missing in XML documentation file. Returned comments tags: Summary, Remarks, Parameters (if present), Responses (if present), Returns Return null if comment for method is not available Return Summary comments for specified type. For Delegate types Parameters field may be returned as well. TypeComment Returns comments for specified class member. Get enum type description and comments for enum values. If is false and no comments exist for any value then ValueComments list is empty. Enum type to get comments for. If this is not an enum type then functions throws an ArgumentException True if ValueComments list should be filled even if none of the enum values have any summary comments EnumComment Enum type comments "summary" comments of enum values. List contains names, values and comments for each enum value. If none of values have any summary comments then this list may be empty. If at least one value has summary comment then this list contains all enum values with empty comments for values without comments. Comment of one enum value The name of the enum value Integer value of the enum Debugging-friendly text. Inheritdoc tag with optional cref attribute. Cref attribute value. This value is optional. Method, operator and constructor comments "param" comments of the method. Each item in the list is the tuple where Item1 is the "name" of the parameter in XML file and Item2 is the body of the comment. "returns" comment of the method. "response" comments of the method. The list contains tuples where Item1 is the "code" of the response and Item1 is the body of the comment. "typeparam" comments of the method. Each item in the list is the tuple where Item1 is the "name" of the parameter in XML file and Item2 is the body of the comment. Class, Struct or delegate comments This list contains descriptions of delegate type parameters. For non-delegate types this list is empty. For delegate types this list contains tuples where Item1 is the "param" item "name" attribute and Item2 is the body of the comment "returns" comment of the method. Class that constructs IDs for XML documentation comments. IDs uniquely identify comments in the XML documentation file. Type member XML ID prefix. Field name XML ID prefix. Property name XML ID prefix. Event XML ID prefix. Type name XML ID prefix. Part of the constructor XML tag in XML document. Get XML Id of the type definition. Get XML Id of a class method Get XML Id of any member of the type. Get XML Id of property Get XML Id of field Get XML Id of event field Get XML Id of specified value of the enum type. Enum type The name of the value without type and namespace Gets the type's full name prepared for xml documentation format. The type. Whether the declaring member for this type is an out directional parameter. If the type is being used has a method parameter. The names of the generic class parameters from the parent type. The full name. Get method element Id in XML document Return true if this method is actually an indexer property. Explicit/implicit operator may have return value appended to the name. Get method name. Some methods have special names or like generic methods some extra information. Specifies that null is allowed as an input even if the corresponding type disallows it. Indicates that the specified method parameter expects a constant. This can be used to inform tooling that a constant should be used as an argument for the annotated parameter. Indicates the minimum bound of the expected constant, inclusive. Indicates the maximum bound of the expected constant, inclusive. Specifies that null is disallowed as an input even if the corresponding type allows it. Applied to a method that will never return under any circumstance. Specifies that the method will not return if the associated Boolean parameter is passed the specified value. Initializes the attribute with the specified parameter value. The condition parameter value. Code after the method will be considered unreachable by diagnostics if the argument to the associated parameter matches this value. Gets the condition parameter value. Indicates that an API is experimental and it may change in the future. This attribute allows call sites to be flagged with a diagnostic that indicates that an experimental feature is used. Authors can use this attribute to ship preview features in their assemblies. Initializes a new instance of the class, specifying the ID that the compiler will use when reporting a use of the API the attribute applies to. The ID that the compiler will use when reporting a use of the API the attribute applies to. Gets the ID that the compiler will use when reporting a use of the API the attribute applies to. The unique diagnostic ID. The diagnostic ID is shown in build output for warnings and errors. This property represents the unique ID that can be used to suppress the warnings or errors, if needed. Gets or sets the URL for corresponding documentation. The API accepts a format string instead of an actual URL, creating a generic URL that includes the diagnostic ID. The format string that represents a URL to corresponding documentation. An example format string is https://contoso.com/obsoletion-warnings/{0}. Specifies that an output may be null even if the corresponding type disallows it. Specifies that when a method returns , the parameter may be null even if the corresponding type disallows it. Initializes the attribute with the specified return value condition. The return value condition. If the method returns this value, the associated parameter may be null. Gets the return value condition. Specifies that the method or property will ensure that the listed field and property members have not-null values. Initializes the attribute with a field or property member. The field or property member that is promised to be not-null. Initializes the attribute with the list of field and property members. The list of field and property members that are promised to be not-null. Gets field or property member names. Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition. Initializes the attribute with the specified return value condition and a field or property member. The return value condition. If the method returns this value, the associated parameter will not be null. The field or property member that is promised to be not-null. Initializes the attribute with the specified return value condition and list of field and property members. The return value condition. If the method returns this value, the associated parameter will not be null. The list of field and property members that are promised to be not-null. Gets the return value condition. Gets field or property member names. Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns. Specifies that the output will be non-null if the named parameter is non-null. Initializes the attribute with the associated parameter name. The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null. Gets the associated parameter name. Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. Initializes the attribute with the specified return value condition. The return value condition. If the method returns this value, the associated parameter will not be null. Gets the return value condition. Specifies that this constructor sets all required members for the current type, and callers do not need to set any required members themselves. Specifies the syntax used in a string. Initializes the with the identifier of the syntax used. The syntax identifier. Initializes the with the identifier of the syntax used. The syntax identifier. Optional arguments associated with the specific syntax employed. Gets the identifier of the syntax used. Optional arguments associated with the specific syntax employed. The syntax identifier for strings containing composite formats for string formatting. The syntax identifier for strings containing date format specifiers. The syntax identifier for strings containing date and time format specifiers. The syntax identifier for strings containing format specifiers. The syntax identifier for strings containing format specifiers. The syntax identifier for strings containing JavaScript Object Notation (JSON). The syntax identifier for strings containing numeric format specifiers. The syntax identifier for strings containing regular expressions. The syntax identifier for strings containing time format specifiers. The syntax identifier for strings containing format specifiers. The syntax identifier for strings containing URIs. The syntax identifier for strings containing XML. Used to indicate a byref escapes and is not scoped. There are several cases where the C# compiler treats a as implicitly - where the compiler does not allow the to escape the method. For example: for instance methods. parameters that refer to types. parameters. This attribute is used in those instances where the should be allowed to escape. Applying this attribute, in any form, has impact on consumers of the applicable API. It is necessary for API authors to understand the lifetime implications of applying this attribute and how it may impact their users. Indicates that certain members on a specified are accessed dynamically, for example through . This allows tools to understand which members are being accessed during the execution of a program. This attribute is valid on members whose type is or . When this attribute is applied to a location of type , the assumption is that the string represents a fully qualified type name. When this attribute is applied to a class, interface, or struct, the members specified can be accessed dynamically on instances returned from calling on instances of that class, interface, or struct. If the attribute is applied to a method it's treated as a special case and it implies the attribute should be applied to the "this" parameter of the method. As such the attribute should only be used on instance methods of types assignable to System.Type (or string, but no methods will use it there). Initializes a new instance of the class with the specified member types. The types of members dynamically accessed. Gets the which specifies the type of members dynamically accessed. Specifies the types of members that are dynamically accessed. This enumeration has a attribute that allows a bitwise combination of its member values. Specifies no members. Specifies the default, parameterless public constructor. Specifies all public constructors. Specifies all non-public constructors. Specifies all public methods. Specifies all non-public methods. Specifies all public fields. Specifies all non-public fields. Specifies all public nested types. Specifies all non-public nested types. Specifies all public properties. Specifies all non-public properties. Specifies all public events. Specifies all non-public events. Specifies all interfaces implemented by the type. Specifies all members. States a dependency that one member has on another. This can be used to inform tooling of a dependency that is otherwise not evident purely from metadata and IL, for example a member relied on via reflection. Initializes a new instance of the class with the specified signature of a member on the same type as the consumer. The signature of the member depended on. Initializes a new instance of the class with the specified signature of a member on a . The signature of the member depended on. The containing . Initializes a new instance of the class with the specified signature of a member on a type in an assembly. The signature of the member depended on. The full name of the type containing the specified member. The assembly name of the type containing the specified member. Initializes a new instance of the class with the specified types of members on a . The types of members depended on. The containing the specified members. Initializes a new instance of the class with the specified types of members on a type in an assembly. The types of members depended on. The full name of the type containing the specified members. The assembly name of the type containing the specified members. Gets the signature of the member depended on. Either must be a valid string or must not equal , but not both. Gets the which specifies the type of members depended on. Either must be a valid string or must not equal , but not both. Gets the containing the specified member. If neither nor are specified, the type of the consumer is assumed. Gets the full name of the type containing the specified member. If neither nor are specified, the type of the consumer is assumed. Gets the assembly name of the specified type. is only valid when is specified. Gets or sets the condition in which the dependency is applicable, e.g. "DEBUG". Indicates that the specified public static boolean get-only property guards access to the specified feature. Analyzers can use this to prevent warnings on calls to code that is annotated as requiring that feature, when the callsite is guarded by a call to the property. Initializes a new instance of the class with the specified feature type. The type that represents the feature guarded by the property. The type that represents the feature guarded by the property. Indicates that the specified public static boolean get-only property corresponds to the feature switch specified by name. IL rewriters and compilers can use this to substitute the return value of the specified property with the value of the feature switch. Initializes a new instance of the class with the specified feature switch name. The name of the feature switch that provides the value for the specified property. The name of the feature switch that provides the value for the specified property. Indicates that the specified member requires assembly files to be on disk. Initializes a new instance of the class. Initializes a new instance of the class. A message that contains information about the need for assembly files to be on disk. Gets an optional message that contains information about the need for assembly files to be on disk. Gets or sets an optional URL that contains more information about the member, why it requires assembly files to be on disk, and what options a consumer has to deal with it. Indicates that the specified method requires the ability to generate new code at runtime, for example through . This allows tools to understand which methods are unsafe to call when compiling ahead of time. Initializes a new instance of the class with the specified message. A message that contains information about the usage of dynamic code. Gets a message that contains information about the usage of dynamic code. Gets or sets an optional URL that contains more information about the method, why it requires dynamic code, and what options a consumer has to deal with it. Indicates that the specified method requires dynamic access to code that is not referenced statically, for example through . This allows tools to understand which methods are unsafe to call when removing unreferenced code from an application. Initializes a new instance of the class with the specified message. A message that contains information about the usage of unreferenced code. Gets a message that contains information about the usage of unreferenced code. Gets or sets an optional URL that contains more information about the method, why it requires unreferenced code, and what options a consumer has to deal with it. Suppresses reporting of a specific rule violation, allowing multiple suppressions on a single code artifact. is different than in that it doesn't have a . So it is always preserved in the compiled assembly. Initializes a new instance of the class, specifying the category of the tool and the identifier for an analysis rule. The category for the attribute. The identifier of the analysis rule the attribute applies to. Gets the category identifying the classification of the attribute. The property describes the tool or tool analysis category for which a message suppression attribute applies. Gets the identifier of the analysis tool rule to be suppressed. Concatenated together, the and properties form a unique check identifier. Gets or sets the scope of the code that is relevant for the attribute. The Scope property is an optional argument that specifies the metadata scope for which the attribute is relevant. Gets or sets a fully qualified path that represents the target of the attribute. The property is an optional argument identifying the analysis target of the attribute. An example value is "System.IO.Stream.ctor():System.Void". Because it is fully qualified, it can be long, particularly for targets such as parameters. The analysis tool user interface should be capable of automatically formatting the parameter. Gets or sets an optional argument expanding on exclusion criteria. The property is an optional argument that specifies additional exclusion where the literal metadata target is not sufficiently precise. For example, the cannot be applied within a method, and it may be desirable to suppress a violation against a statement in the method that will give a rule violation, but not against all statements in the method. Gets or sets the justification for suppressing the code analysis message. If a .NET Debugger is attached which supports the Debugger.BreakForUserUnhandledException(Exception) API, this attribute will prevent the debugger from breaking on user-unhandled exceptions when the exception is caught by a method with this attribute, unless BreakForUserUnhandledException is called. Types and Methods attributed with StackTraceHidden will be omitted from the stack trace text shown in StackTrace.ToString() and Exception.StackTrace Initializes a new instance of the class. Represent a type can be used to index a collection either from the start or the end. Index is used by the C# compiler to support the new index syntax int[] someArray = new int[5] { 1, 2, 3, 4, 5 } ; int lastElement = someArray[^1]; // lastElement = 5 Construct an Index using a value and indicating if the index is from the start or from the end. The index value. it has to be zero or positive number. Indicating if the index is from the start or from the end. If the Index constructed from the end, index value 1 means pointing at the last element and index value 0 means pointing at beyond last element. Create an Index pointing at first element. Create an Index pointing at beyond last element. Create an Index from the start at the position indicated by the value. The index value from the start. Create an Index from the end at the position indicated by the value. The index value from the end. Returns the index value. Indicates whether the index is from the start or the end. Calculate the offset from the start using the giving collection length. The length of the collection that the Index will be used with. length has to be a positive value For performance reason, we don't validate the input length parameter and the returned offset value against negative values. we don't validate either the returned offset is greater than the input length. It is expected Index will be used with collections which always have non negative length/count. If the returned offset is negative and then used to index a collection will get out of range exception which will be same affect as the validation. Indicates whether the current Index object is equal to another object of the same type. An object to compare with this object Indicates whether the current Index object is equal to another Index object. An object to compare with this object Returns the hash code for this instance. Converts integer number to an Index. Converts the value of the current Index object to its equivalent string representation. Represent a range has start and end indexes. Range is used by the C# compiler to support the range syntax. int[] someArray = new int[5] { 1, 2, 3, 4, 5 }; int[] subArray1 = someArray[0..2]; // { 1, 2 } int[] subArray2 = someArray[1..^0]; // { 2, 3, 4, 5 } Represent the inclusive start index of the Range. Represent the exclusive end index of the Range. Construct a Range object using the start and end indexes. Represent the inclusive start index of the range. Represent the exclusive end index of the range. Indicates whether the current Range object is equal to another object of the same type. An object to compare with this object Indicates whether the current Range object is equal to another Range object. An object to compare with this object Returns the hash code for this instance. Converts the value of the current Range object to its equivalent string representation. Create a Range object starting from start index to the end of the collection. Create a Range object starting from first element in the collection to the end Index. Create a Range object starting from first element to the end. Calculate the start offset and length of range object using a collection length. The length of the collection that the range will be used with. length has to be a positive value. For performance reason, we don't validate the input length parameter against negative values. It is expected Range will be used with collections which always have non negative length/count. We validate the range is inside the length scope though. An attribute that allows parameters to receive the expression of other parameters. Initializes a new instance of the class. The condition parameter value. Gets the parameter name the expression is retrieved from. Initialize the attribute to refer to the method on the type. The type of the builder to use to construct the collection. The name of the method on the builder to use to construct the collection. must refer to a static method that accepts a single parameter of type and returns an instance of the collection being built containing a copy of the data from that span. In future releases of .NET, additional patterns may be supported. Gets the type of the builder to use to construct the collection. Gets the name of the method on the builder to use to construct the collection. This should match the metadata name of the target method. For example, this might be ".ctor" if targeting the type's constructor. Indicates that compiler support for a particular feature is required for the location where this attribute is applied. Creates a new instance of the type. The name of the feature to indicate. The name of the compiler feature. If true, the compiler can choose to allow access to the location where this attribute is applied if it does not understand . The used for the ref structs C# feature. The used for the required members C# feature. Indicates which arguments to a method involving an interpolated string handler should be passed to that handler. Initializes a new instance of the class. The name of the argument that should be passed to the handler. may be used as the name of the receiver in an instance method. Initializes a new instance of the class. The names of the arguments that should be passed to the handler. may be used as the name of the receiver in an instance method. Gets the names of the arguments that should be passed to the handler. may be used as the name of the receiver in an instance method. Indicates the attributed type is to be used as an interpolated string handler. Reserved to be used by the compiler for tracking metadata. This class should not be used by developers in source code. Used to indicate to the compiler that a method should be called in its containing module's initializer. When one or more valid methods with this attribute are found in a compilation, the compiler will emit a module initializer which calls each of the attributed methods. Certain requirements are imposed on any method targeted with this attribute: - The method must be `static`. - The method must be an ordinary member method, as opposed to a property accessor, constructor, local function, etc. - The method must be parameterless. - The method must return `void`. - The method must not be generic or be contained in a generic type. - The method's effective accessibility must be `internal` or `public`. The specification for module initializers in the .NET runtime can be found here: https://github.com/dotnet/runtime/blob/main/docs/design/specs/Ecma-335-Augments.md#module-initializer Specifies the priority of a member in overload resolution. When unspecified, the default priority is 0. Initializes a new instance of the class. The priority of the attributed member. Higher numbers are prioritized, lower numbers are deprioritized. 0 is the default if no attribute is present. The priority of the member. Indicates that a method will allow a variable number of arguments in its invocation. Specifies that a type has required members or that a member is required. Reserved for use by a compiler for tracking metadata. This attribute should not be used by developers in source code. Used to indicate to the compiler that the .locals init flag should not be set in method headers. Disables the built-in runtime managed/unmanaged marshalling subsystem for P/Invokes, Delegate types, and unmanaged function pointer invocations. The built-in marshalling subsystem has some behaviors that cannot be changed due to backward-compatibility requirements. This attribute allows disabling the built-in subsystem and instead uses the following rules for P/Invokes, Delegates, and unmanaged function pointer invocations: - All value types that do not contain reference type fields recursively (unmanaged in C#) are blittable - Value types that recursively have any fields that have [StructLayout(LayoutKind.Auto)] are disallowed from interop. - All reference types are disallowed from usage in interop scenarios. - SetLastError support in P/Invokes is disabled. - varargs support is disabled. - LCIDConversionAttribute support is disabled. Provides access to an inaccessible member of a specific type. This attribute may be applied to an extern static method. The implementation of the extern static method annotated with this attribute will be provided by the runtime based on the information in the attribute and the signature of the method that the attribute is applied to. The runtime will try to find the matching method or field and forward the call to it. If the matching method or field is not found, the body of the extern method will throw or . Only the specific type defined will be examined for inaccessible members. The type hierarchy is not walked looking for a match. For , , , and , the type of the first argument of the annotated extern method identifies the owning type. The value of the first argument is treated as this pointer for instance fields and methods. The first argument must be passed as ref for instance fields and methods on structs. The value of the first argument is not used by the implementation for static fields and methods. Return type is considered for the signature match. modreqs and modopts are initially not considered for the signature match. However, if an ambiguity exists ignoring modreqs and modopts, a precise match is attempted. If an ambiguity still exists is thrown. By default, the attributed method's name dictates the name of the method/field. This can cause confusion in some cases since language abstractions, like C# local functions, generate mangled IL names. The solution to this is to use the nameof mechanism and define the property. public void Method(Class c) { PrivateMethod(c); [UnsafeAccessor(UnsafeAccessorKind.Method, Name = nameof(PrivateMethod))] extern static void PrivateMethod(Class c); } Instantiates an providing access to a member of kind . The kind of the target to which access is provided. Gets the kind of member to which access is provided. Gets or sets the name of the member to which access is provided. The name defaults to the annotated method name if not specified. The name must be unset/null for . Specifies the kind of target to which an is providing access. Provide access to a constructor. Provide access to a method. Provide access to a static method. Provide access to a field. Provide access to a static field. Initializes a new instance of the class. Initializes a new instance of the class with the specified message. An optional message associated with this attribute instance. Returns the optional message associated with this attribute instance. Returns the optional URL associated with this attribute instance. Marks APIs that were obsoleted in a given operating system version. Primarily used by OS bindings to indicate APIs that should not be used anymore. Records the operating system (and minimum version) that supports an API. Multiple attributes can be applied to indicate support on multiple operating systems. Callers can apply a or use guards to prevent calls to APIs on unsupported operating systems. A given platform should only be specified once. Annotates a custom guard field, property or method with a supported platform name and optional version. Multiple attributes can be applied to indicate guard for multiple supported platforms. Callers can apply a to a field, property or method and use that field, property or method in a conditional or assert statements in order to safely call platform specific APIs. The type of the field or property should be boolean, the method return type should be boolean in order to be used as platform guard. Records the platform that the project targeted. Marks APIs that were removed in a given operating system version. Primarily used by OS bindings to indicate APIs that are only available in earlier versions. Annotates the custom guard field, property or method with an unsupported platform name and optional version. Multiple attributes can be applied to indicate guard for multiple unsupported platforms. Callers can apply a to a field, property or method and use that field, property or method in a conditional or assert statements as a guard to safely call APIs unsupported on those platforms. The type of the field or property should be boolean, the method return type should be boolean in order to be used as platform guard. Indicates that the instance's storage is sequentially replicated "length" times. This attribute can be used to annotate a type with a single field. The runtime will replicate that field in the actual type layout as many times as is specified. Here's an example of how an inline array type with 8 values can be declared: [InlineArray(8)] struct Float8InlineArray { private float _value; } Creates a new instance with the specified length. The number of sequential fields to replicate in the inline array type. Gets the number of sequential fields to replicate in the inline array type. An attribute used to indicate a GC transition should be skipped when making an unmanaged function call. Example of a valid use case. The Win32 `GetTickCount()` function is a small performance related function that reads some global memory and returns the value. In this case, the GC transition overhead is significantly more than the memory read. using System; using System.Runtime.InteropServices; class Program { [DllImport("Kernel32")] [SuppressGCTransition] static extern int GetTickCount(); static void Main() { Console.WriteLine($"{GetTickCount()}"); } } This attribute is ignored if applied to a method without the . Forgoing this transition can yield benefits when the cost of the transition is more than the execution time of the unmanaged function. However, avoiding this transition removes some of the guarantees the runtime provides through a normal P/Invoke. When exiting the managed runtime to enter an unmanaged function the GC must transition from Cooperative mode into Preemptive mode. Full details on these modes can be found at https://github.com/dotnet/runtime/blob/main/docs/coding-guidelines/clr-code-guide.md#2.1.8. Suppressing the GC transition is an advanced scenario and should not be done without fully understanding potential consequences. One of these consequences is an impact to Mixed-mode debugging (https://docs.microsoft.com/visualstudio/debugger/how-to-debug-in-mixed-mode). During Mixed-mode debugging, it is not possible to step into or set breakpoints in a P/Invoke that has been marked with this attribute. A workaround is to switch to native debugging and set a breakpoint in the native function. In general, usage of this attribute is not recommended if debugging the P/Invoke is important, for example stepping through the native code or diagnosing an exception thrown from the native code. The runtime may load the native library for method marked with this attribute in advance before the method is called for the first time. Usage of this attribute is not recommended for platform neutral libraries with conditional platform specific code. The P/Invoke method that this attribute is applied to must have all of the following properties: * Native function always executes for a trivial amount of time (less than 1 microsecond). * Native function does not perform a blocking syscall (e.g. any type of I/O). * Native function does not call back into the runtime (e.g. Reverse P/Invoke). * Native function does not throw exceptions. * Native function does not manipulate locks or other concurrency primitives. Consequences of invalid uses of this attribute: * GC starvation. * Immediate runtime termination. * Data corruption. Any method marked with can be directly called from native code. The function token can be loaded to a local variable using the address-of operator in C# and passed as a callback to a native method. Methods marked with this attribute have the following restrictions: * Method must be marked "static". * Must not be called from managed code. * Must only have blittable arguments. Optional. If omitted, the runtime will use the default platform calling convention. Supplied types must be from the official "System.Runtime.CompilerServices" namespace and be of the form "CallConvXXX". Optional. If omitted, no named export is emitted during compilation. Specifies that the P/Invoke marked with this attribute should be linked in as a WASM import. See https://webassembly.github.io/spec/core/syntax/modules.html#imports. Instance constructor.