ModelMemberCollection<TItemType,TFindType>.Find 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.
Searches the collection for the given key and returns it if it is found.
Overloads
Find(String) |
Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns |
Find(TFindType) |
Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns |
Find(String, Boolean) |
When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns |
Find(TFindType, Boolean) |
When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns |
Find(String)
Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns null
.
public:
TItemType Find(System::String ^ name);
public TItemType Find (string name);
member this.Find : string -> 'ItemType
Public Function Find (name As String) As TItemType
Parameters
- name
- String
The name of the given key.
Returns
If found, returns the item.
Exceptions
The name
is null
.
Applies to
Find(TFindType)
Searches the collection for the given key and returns it if it is found. If the key is not found, this method returns null
.
public:
TItemType Find(TFindType value);
public TItemType Find (TFindType value);
member this.Find : 'FindType -> 'ItemType
Public Function Find (value As TFindType) As TItemType
Parameters
- value
- TFindType
The type of the given key.
Returns
If found, returns the item.
Exceptions
The value
is null
.
Applies to
Find(String, Boolean)
When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns null
, depending on the value passed to throwOnError
.
protected:
abstract TItemType Find(System::String ^ name, bool throwOnError);
protected abstract TItemType Find (string name, bool throwOnError);
abstract member Find : string * bool -> 'ItemType
Protected MustOverride Function Find (name As String, throwOnError As Boolean) As TItemType
Parameters
- name
- String
The name of the given key.
- throwOnError
- Boolean
true
to throw an exception if the given key is not found; otherwise, false
.
Returns
If found, returns the item.
Exceptions
The name
is not found and throwOnError
is true
.
Applies to
Find(TFindType, Boolean)
When overridden in a derived class, searches the collection for the given key and returns it if it is found. If the key is not found, this method throws an exception or returns null
, depending on the value passed to throwOnError
.
protected:
abstract TItemType Find(TFindType value, bool throwOnError);
protected abstract TItemType Find (TFindType value, bool throwOnError);
abstract member Find : 'FindType * bool -> 'ItemType
Protected MustOverride Function Find (value As TFindType, throwOnError As Boolean) As TItemType
Parameters
- value
- TFindType
The type of the given key.
- throwOnError
- Boolean
true
to throw an exception if the given key is not found; otherwise, false
.
Returns
If found, returns the item.
Exceptions
The value
is not found and throwOnError
is true
.