Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Core.OptionalArgumentAttribute Class (F#)

This attribute is added automatically for all optional arguments.

Namespace/Module Path: Microsoft.FSharp.Core

Assembly: FSharp.Core (in FSharp.Core.dll)

[<AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)>]
type OptionalArgumentAttribute =
  new OptionalArgumentAttribute : unit -> OptionalArgumentAttribute

You can apply this attribute to a parameter that is an option type to make it an optional parameter. This is the equivalent of applying a ? to the parameter name in the parameter list. Optional parameters should not be followed by non-optional parameters in the parameter list.

You can also use the short form of the name, OptionalArgument.




Creates an instance of the attribute

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

© 2015 Microsoft