PropertyBag.FirstOrDefault<TProperty> 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.
Returns the first property of the TProperty type, or default if none is found.
Unlike SingleOrDefault<TProperty>(), this method does not throw when multiple properties of the
same type are present β it simply returns the first one encountered.
public TProperty? FirstOrDefault<TProperty>() where TProperty : Microsoft.Testing.Platform.Extensions.Messages.IProperty;
member this.FirstOrDefault : unit -> 'Property (requires 'Property :> Microsoft.Testing.Platform.Extensions.Messages.IProperty)
Public Function FirstOrDefault(Of TProperty As IProperty) () As TProperty
Type Parameters
- TProperty
The type of the property.
Returns
The first property of the given type, or default if none is found.