Method FindItemsByCategory
FindItemsByCategory(Category, ICollection<TItem>)
Fills in the given target collection with all
TItem instances of this catalog matching the
given category and returns their count.
The target collection is cleared before being
populated.
Declaration
public int FindItemsByCategory(Category category, ICollection<TItem> target = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Category | category | The Category instance used as a filter |
| ICollection<TItem> | target | The target container of all the matching
|
Returns
| Type | Description |
|---|---|
| int | The number of |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If the
|
FindItemsByCategory(string, ICollection<TItem>)
Fills in the given target collection with all
TItem instances of this catalog matching the
Category by its id and returns
their count.
The target collection is cleared before being
populated.
Declaration
public int FindItemsByCategory(string id, ICollection<TItem> target = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The identifier of the Category used as a filter |
| ICollection<TItem> | target | The target container of all the matching
|
Returns
| Type | Description |
|---|---|
| int | The number of |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If the
|
| ArgumentException | If there is no
Category instance with the given
|
FindItemsByCategory(Category)
Returns the array of all the TItem instances
of this catalog matching the given Category.
Declaration
public TItem[] FindItemsByCategory(Category category)
Parameters
| Type | Name | Description |
|---|---|---|
| Category | category | The Category instance used as a filter |
Returns
| Type | Description |
|---|---|
| TItem[] | The array of all the |
Remarks
Keep in mind that this method allocates an array. If you want to avoid allocations, please consider using FindItemsByCategory(Category, ICollection<TItem>) instead.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | If the
|
FindItemsByCategory(string)
Returns an array of all the TItem instances
of this catalog matching the Category by its
id.
Declaration
public TItem[] FindItemsByCategory(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| string | id | The identifier of the Category used as a filter |
Returns
| Type | Description |
|---|---|
| TItem[] | The array of all the |
Remarks
Keep in mind that this method allocates an array. If you want to avoid allocations, please consider using FindItemsByCategory(string, ICollection<TItem>) instead.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If the
|
| ArgumentException | If there is no
Category instance with the given
|