Summary
Splits a sequence of documents into groups based on a specified function or metadata key.
- Assembly
- Wyam
.Core .dll - Namespace
- Wyam
.Core .Modules .Control - Interfaces
-
- IModule
- IModuleList
- IList
<IModule>
- Base Types
-
- Object
- ContainerModule
graph BT
Type-->Base0["ContainerModule"]
click Base0 "/api/Wyam.Common.Modules/ContainerModule"
Base0-->Base1["Object"]
Type-.->Interface0["IModule"]
click Interface0 "/api/Wyam.Common.Modules/IModule"
Type-.->Interface1["IModuleList"]
click Interface1 "/api/Wyam.Common.Modules/IModuleList"
Type-.->Interface2["IList<IModule>"]
Type["GroupBy"]
class Type type-node
Syntax
public class GroupBy : ContainerModule, IModule, IModuleList, IList<IModule>
Remarks
This module forms groups from the output documents of the specified modules.
Each input document is cloned for each group and metadata related
to the groups, including the sequence of documents for each group,
is added to each clone. For example, if you have 2 input documents
and the result of grouping is 3 groups, this module will output 6 documents.
Constructors
Name | Summary |
---|---|
GroupBy |
Partitions the result of the specified modules into groups with matching keys based on the key delegate. The input documents to GroupBy are used as the initial input documents to the specified modules. |
GroupBy |
Partitions the result of the specified modules into groups with matching keys based on the key delegate. The input documents to GroupBy are used as the initial input documents to the specified modules. |
GroupBy |
Partitions the result of the specified modules into groups with matching keys based on the value at the specified metadata key. If a document to group does not contain the specified metadata key, it is not included in any output groups. The input documents to GroupBy are used as the initial input documents to the specified modules. |
GroupBy |
Partitions the result of the specified modules into groups with matching keys based on the value at the specified metadata key. If a document to group does not contain the specified metadata key, it is not included in any output groups. The input documents to GroupBy are used as the initial input documents to the specified modules. |
Properties
Name | Value | Summary |
---|---|---|
Count | int |
Inherited from ContainerModule
|
IsReadOnly | bool |
Inherited from ContainerModule
|
this[int] | IModule |
Inherited from ContainerModule
|
this[string] | IModule |
Gets the module with the specified name.
Inherited from ContainerModule
|
Methods
Name | Value | Summary |
---|---|---|
Add |
void |
Inherited from ContainerModule
|
Add |
void |
Adds modules to the list.
Any
null items in the sequence of modules will be discarded.
Inherited from ContainerModule
|
Add |
void |
Adds a module to the list with a specified name.
Inherited from ContainerModule
|
AsKeyValuePairs |
IEnumerable |
Returns the list as a sequence of key-value pairs with the keys being
the module names and the values being the module instances.
Inherited from ContainerModule
|
Clear |
void |
Inherited from ContainerModule
|
Contains |
bool |
Inherited from ContainerModule
|
Contains |
bool |
Determines if the list contains a module with the specified name.
Inherited from ContainerModule
|
CopyTo |
void |
Inherited from ContainerModule
|
Execute |
IEnumerable |
This should not be called directly, instead call
IExecutionContext.Execute() if you need to execute a module from within another module.
|
GetEnumerator |
IEnumerator |
Inherited from ContainerModule
|
IndexOf |
int |
Inherited from ContainerModule
|
IndexOf |
int |
Gets the index of the module with the specified name.
Inherited from ContainerModule
|
Insert |
void |
Inherited from ContainerModule
|
Insert |
void |
Inserts modules into the list.
Any
null items in the sequence of modules will be discarded.
Inherited from ContainerModule
|
Insert |
void |
Inserts a module into the list with a specified name.
Inherited from ContainerModule
|
Remove |
bool |
Inherited from ContainerModule
|
Remove |
bool |
Removes a module by name.
Inherited from ContainerModule
|
RemoveAt |
void |
Inherited from ContainerModule
|
TryGetValue |
bool |
Attempts to get a module with the specified name.
Inherited from ContainerModule
|
Where |
GroupBy |
Limits the documents to be grouped to those that satisfy the supplied predicate.
|
WithComparer |
GroupBy |
Specifies an equality comparer to use for the grouping.
|
WithComparer |
GroupBy |
Specifies a typed equality comparer to use for the grouping. A conversion to the
comparer type will be attempted for all metadata values. If the conversion fails,
the value will not be considered equal. Note that this will also have the effect
of treating different convertible types as being of the same type. For example,
if you have two group keys, 1 and "1" (in that order), and use a string-based comparison, you will
only end up with a single group for those documents with a group key of 1 (since the
int key came first).
|
With |
GroupBy |
Specifies that no documents should be output if there are no groups. This is in contrast to the
default behavior of outputting the unmodified input documents if no groups were found.
|