DocScenarioAttributeType

PackageFsLiveDocs.Annotations

DocScenarioAttribute

DocScenarioAttribute marks deterministic setup code for a named XML documentation example. It is the public API of the lightweight FsLiveDocs.Annotations library package.

Apply it to a public, parameterless F# function that compiles to a static method. Pass the same unique name to the attribute and to the XML example's scenario attribute.

open FsLiveDocs

module CustomerExamples =
    let mutable private currentCustomer = "anonymous"

    [<DocScenario("preferred-customer")>]
    let preparePreferredCustomer () =
        currentCustomer <- "Ada"

The constructor accepts the scenario name. The read-only Name property exposes that value to FsLiveDocs during documentation discovery.

Prepare an XML example has a complete example and the execution rules.

Specification

Kind
Type
Members
2
Examples
0
``.ctor``Signature
DocScenarioAttribute(name)
NameSignature
this.Name

Summary

NameSignatureSynopsis
``.ctor``DocScenarioAttribute(name)No description available.
Namethis.NameThe unique scenario name referenced by an XML example.

``.ctor``

DocScenarioAttribute(name)
Member

Parameters

NameTypeDescription
namestring

Returns

DocScenarioAttribute

Name

this.Name
Member
The unique scenario name referenced by an XML example.

Returns

string