Guard.HasSizeLessThanOrEqualTo 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.
Overloads
HasSizeLessThanOrEqualTo(String, Int32, String) |
Asserts that the input String instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo(String, String, String) |
Asserts that the source String instance must have a size of less than or equal to that of a destination String instance. |
HasSizeLessThanOrEqualTo<T>(T[], Int32, String) |
Asserts that the input array instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(Span<T>, Span<T>, String) |
Asserts that the source Span<T> instance must have a size of less than or equal to that of a destination Span<T> instance. |
HasSizeLessThanOrEqualTo<T>(Span<T>, Int32, String) |
Asserts that the input Span<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(ReadOnlySpan<T>, Span<T>, String) |
Asserts that the source ReadOnlySpan<T> instance must have a size of less than or equal to that of a destination ReadOnlySpan<T> instance. |
HasSizeLessThanOrEqualTo<T>(ReadOnlySpan<T>, Int32, String) |
Asserts that the input ReadOnlySpan<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(ReadOnlyMemory<T>, Memory<T>, String) |
Asserts that the source ReadOnlyMemory<T> instance must have a size of less than or equal to that of a destination ReadOnlyMemory<T> instance. |
HasSizeLessThanOrEqualTo<T>(ReadOnlyMemory<T>, Int32, String) |
Asserts that the input ReadOnlyMemory<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(T[], T[], String) |
Asserts that the source array instance must have a size of less than or equal to that of a destination array instance. |
HasSizeLessThanOrEqualTo<T>(Memory<T>, Int32, String) |
Asserts that the input Memory<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(List<T>, Int32, String) |
Asserts that the input List<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(List<T>, List<T>, String) |
Asserts that the source List<T> instance must have a size of less than or equal to that of a destination List<T> instance. |
HasSizeLessThanOrEqualTo<T>(IReadOnlyCollection<T>, Int32, String) |
Asserts that the input IReadOnlyCollection<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(IReadOnlyCollection<T>, ICollection<T>, String) |
Asserts that the source IReadOnlyCollection<T> instance must have a size of less than or equal to that of a destination IReadOnlyCollection<T> instance. |
HasSizeLessThanOrEqualTo<T>(ICollection<T>, Int32, String) |
Asserts that the input ICollection<T> instance must have a size of less than or equal to a specified value. |
HasSizeLessThanOrEqualTo<T>(ICollection<T>, ICollection<T>, String) |
Asserts that the source ICollection<T> instance must have a size of less than or equal to that of a destination ICollection<T> instance. |
HasSizeLessThanOrEqualTo<T>(Memory<T>, Memory<T>, String) |
Asserts that the source Memory<T> instance must have a size of less than or equal to that of a destination Memory<T> instance. |
HasSizeLessThanOrEqualTo(String, Int32, String)
Asserts that the input String instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo (string text, int size, string name);
static member HasSizeLessThanOrEqualTo : string * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo (text As String, size As Integer, name As String)
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of text
is > size
.
Applies to
HasSizeLessThanOrEqualTo(String, String, String)
public static void HasSizeLessThanOrEqualTo (string source, string destination, string name);
static member HasSizeLessThanOrEqualTo : string * string * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo (source As String, destination As String, name As String)
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Remarks
The String type is immutable, but the name of this API is kept for consistency with the other overloads.
Applies to
HasSizeLessThanOrEqualTo<T>(T[], Int32, String)
Asserts that the input array instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (T[] array, int size, string name);
static member HasSizeLessThanOrEqualTo : 'T[] * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (array As T(), size As Integer, name As String)
Type Parameters
- T
The item of items in the input array instance.
Parameters
- array
- T[]
The input array instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of array
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(Span<T>, Span<T>, String)
public static void HasSizeLessThanOrEqualTo<T> (Span<T> source, Span<T> destination, string name);
static member HasSizeLessThanOrEqualTo : Span<'T> * Span<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As Span(Of T), destination As Span(Of T), name As String)
Type Parameters
- T
The item of items in the input Span<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(Span<T>, Int32, String)
Asserts that the input Span<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (Span<T> span, int size, string name);
static member HasSizeLessThanOrEqualTo : Span<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (span As Span(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input Span<T> instance.
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of span
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(ReadOnlySpan<T>, Span<T>, String)
Asserts that the source ReadOnlySpan<T> instance must have a size of less than or equal to that of a destination ReadOnlySpan<T> instance.
public static void HasSizeLessThanOrEqualTo<T> (ReadOnlySpan<T> source, Span<T> destination, string name);
static member HasSizeLessThanOrEqualTo : ReadOnlySpan<'T> * Span<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As ReadOnlySpan(Of T), destination As Span(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlySpan<T> instance.
Parameters
- source
- ReadOnlySpan<T>
The source ReadOnlySpan<T> instance to check the size for.
- destination
- Span<T>
The destination ReadOnlySpan<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(ReadOnlySpan<T>, Int32, String)
Asserts that the input ReadOnlySpan<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (ReadOnlySpan<T> span, int size, string name);
static member HasSizeLessThanOrEqualTo : ReadOnlySpan<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (span As ReadOnlySpan(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input ReadOnlySpan<T> instance.
Parameters
- span
- ReadOnlySpan<T>
The input ReadOnlySpan<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of span
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(ReadOnlyMemory<T>, Memory<T>, String)
Asserts that the source ReadOnlyMemory<T> instance must have a size of less than or equal to that of a destination ReadOnlyMemory<T> instance.
public static void HasSizeLessThanOrEqualTo<T> (ReadOnlyMemory<T> source, Memory<T> destination, string name);
static member HasSizeLessThanOrEqualTo : ReadOnlyMemory<'T> * Memory<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As ReadOnlyMemory(Of T), destination As Memory(Of T), name As String)
Type Parameters
- T
The item of items in the input ReadOnlyMemory<T> instance.
Parameters
- source
- ReadOnlyMemory<T>
The source ReadOnlyMemory<T> instance to check the size for.
- destination
- Memory<T>
The destination ReadOnlyMemory<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(ReadOnlyMemory<T>, Int32, String)
Asserts that the input ReadOnlyMemory<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (ReadOnlyMemory<T> memory, int size, string name);
static member HasSizeLessThanOrEqualTo : ReadOnlyMemory<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (memory As ReadOnlyMemory(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input ReadOnlyMemory<T> instance.
Parameters
- memory
- ReadOnlyMemory<T>
The input ReadOnlyMemory<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of memory
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(T[], T[], String)
Asserts that the source array instance must have a size of less than or equal to that of a destination array instance.
public static void HasSizeLessThanOrEqualTo<T> (T[] source, T[] destination, string name);
static member HasSizeLessThanOrEqualTo : 'T[] * 'T[] * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As T(), destination As T(), name As String)
Type Parameters
- T
The item of items in the input array instance.
Parameters
- source
- T[]
The source array instance to check the size for.
- destination
- T[]
The destination array instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(Memory<T>, Int32, String)
Asserts that the input Memory<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (Memory<T> memory, int size, string name);
static member HasSizeLessThanOrEqualTo : Memory<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (memory As Memory(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input Memory<T> instance.
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of memory
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(List<T>, Int32, String)
Asserts that the input List<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (System.Collections.Generic.List<T> list, int size, string name);
static member HasSizeLessThanOrEqualTo : System.Collections.Generic.List<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (list As List(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input List<T> instance.
Parameters
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of list
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(List<T>, List<T>, String)
public static void HasSizeLessThanOrEqualTo<T> (System.Collections.Generic.List<T> source, System.Collections.Generic.List<T> destination, string name);
static member HasSizeLessThanOrEqualTo : System.Collections.Generic.List<'T> * System.Collections.Generic.List<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As List(Of T), destination As List(Of T), name As String)
Type Parameters
- T
The item of items in the input List<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(IReadOnlyCollection<T>, Int32, String)
Asserts that the input IReadOnlyCollection<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (System.Collections.Generic.IReadOnlyCollection<T> collection, int size, string name);
static member HasSizeLessThanOrEqualTo : System.Collections.Generic.IReadOnlyCollection<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (collection As IReadOnlyCollection(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input IReadOnlyCollection<T> instance.
Parameters
- collection
- IReadOnlyCollection<T>
The input IReadOnlyCollection<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of collection
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(IReadOnlyCollection<T>, ICollection<T>, String)
Asserts that the source IReadOnlyCollection<T> instance must have a size of less than or equal to that of a destination IReadOnlyCollection<T> instance.
public static void HasSizeLessThanOrEqualTo<T> (System.Collections.Generic.IReadOnlyCollection<T> source, System.Collections.Generic.ICollection<T> destination, string name);
static member HasSizeLessThanOrEqualTo : System.Collections.Generic.IReadOnlyCollection<'T> * System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As IReadOnlyCollection(Of T), destination As ICollection(Of T), name As String)
Type Parameters
- T
The item of items in the input IReadOnlyCollection<T> instance.
Parameters
- source
- IReadOnlyCollection<T>
The source IReadOnlyCollection<T> instance to check the size for.
- destination
- ICollection<T>
The destination IReadOnlyCollection<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(ICollection<T>, Int32, String)
Asserts that the input ICollection<T> instance must have a size of less than or equal to a specified value.
public static void HasSizeLessThanOrEqualTo<T> (System.Collections.Generic.ICollection<T> collection, int size, string name);
static member HasSizeLessThanOrEqualTo : System.Collections.Generic.ICollection<'T> * int * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (collection As ICollection(Of T), size As Integer, name As String)
Type Parameters
- T
The item of items in the input ICollection<T> instance.
Parameters
- collection
- ICollection<T>
The input ICollection<T> instance to check the size for.
- size
- Int32
The target size to test.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of collection
is > size
.
Applies to
HasSizeLessThanOrEqualTo<T>(ICollection<T>, ICollection<T>, String)
Asserts that the source ICollection<T> instance must have a size of less than or equal to that of a destination ICollection<T> instance.
public static void HasSizeLessThanOrEqualTo<T> (System.Collections.Generic.ICollection<T> source, System.Collections.Generic.ICollection<T> destination, string name);
static member HasSizeLessThanOrEqualTo : System.Collections.Generic.ICollection<'T> * System.Collections.Generic.ICollection<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As ICollection(Of T), destination As ICollection(Of T), name As String)
Type Parameters
- T
The item of items in the input ICollection<T> instance.
Parameters
- source
- ICollection<T>
The source ICollection<T> instance to check the size for.
- destination
- ICollection<T>
The destination ICollection<T> instance to check the size for.
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.
Applies to
HasSizeLessThanOrEqualTo<T>(Memory<T>, Memory<T>, String)
public static void HasSizeLessThanOrEqualTo<T> (Memory<T> source, Memory<T> destination, string name);
static member HasSizeLessThanOrEqualTo : Memory<'T> * Memory<'T> * string -> unit
Public Shared Sub HasSizeLessThanOrEqualTo(Of T) (source As Memory(Of T), destination As Memory(Of T), name As String)
Type Parameters
- T
The item of items in the input Memory<T> instance.
Parameters
- name
- String
The name of the input parameter being tested.
Exceptions
Thrown if the size of source
is > the one of destination
.