Class UpstreamSourceFilter
Implements a filter for updates based by product and/or classification.
The filter is used for selectively sync'ing updates from an upstream update server through IMetadataSource
The filter can also be used to selectively copy updates between IMetadataStore. The more versatile MetadataFilter should be used for this scenario instead.
Inheritance
Implements
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Source
Assembly: package-graph-microsoftupdate-source.dll
Syntax
public class UpstreamSourceFilter : IMetadataFilter
Constructors
| Improve this Doc View SourceUpstreamSourceFilter()
Creates an empty filter.
Declaration
[JsonConstructor]
public UpstreamSourceFilter()
UpstreamSourceFilter(IEnumerable<Guid>, IEnumerable<Guid>)
Initialize a new SourceFilter from the specified products and classifications.
Declaration
public UpstreamSourceFilter(IEnumerable<Guid> products, IEnumerable<Guid> classifications)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Guid> | products | The products to match |
System.Collections.Generic.IEnumerable<System.Guid> | classifications | The classifications to match |
Properties
| Improve this Doc View SourceClassificationsFilter
Gets the list of classifications allowed by the filter. If this list if empty, no updates will match the filter. Add classification IDs to this list to have them match the filter.
Declaration
[JsonProperty]
public List<Guid> ClassificationsFilter { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Guid> | List of classification identities. |
ProductsFilter
Gets the list of products allowed by the filter. If this list if empty, no updates will match the filter. Add product IDs to this list to have them match the filter.
Declaration
[JsonProperty]
public List<Guid> ProductsFilter { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Guid> | List of product identities. |
Methods
| Improve this Doc View SourceApply(IMetadataStore)
Applies the filter to a IMetadataStore and returns the matched packages
Declaration
public IEnumerable<IPackage> Apply(IMetadataStore source)
Parameters
Type | Name | Description |
---|---|---|
IMetadataStore | source | The metadata IMetadataStore to filter |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<IPackage> | List of packages that match the filter |
Equals(Object)
Override Equals for 2 SourceFilter objects
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Other SourceFilter |
Returns
Type | Description |
---|---|
System.Boolean | True if the two SourceFilter are identical (same product and classification filters). False otherwise |
Overrides
GetHashCode()
Returns a hash code based on the hash codes of the contained classification and products
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code |
Overrides
Operators
| Improve this Doc View SourceEquality(UpstreamSourceFilter, UpstreamSourceFilter)
Override equality operator SourceFilter objects
Declaration
public static bool operator ==(UpstreamSourceFilter lhs, UpstreamSourceFilter rhs)
Parameters
Type | Name | Description |
---|---|---|
UpstreamSourceFilter | lhs | Left SourceFilter |
UpstreamSourceFilter | rhs | Right SourceFilter |
Returns
Type | Description |
---|---|
System.Boolean | True if both lhs and rhs are SourceFilter and they contain the same classification and product filters False otherwise |
Inequality(UpstreamSourceFilter, UpstreamSourceFilter)
Override inequality operator SourceFilter objects
Declaration
public static bool operator !=(UpstreamSourceFilter lhs, UpstreamSourceFilter rhs)
Parameters
Type | Name | Description |
---|---|---|
UpstreamSourceFilter | lhs | Left SourceFilter |
UpstreamSourceFilter | rhs | Right SourceFilter |
Returns
Type | Description |
---|---|
System.Boolean | True if both lhs and rhs are not QueryFilter or they contain different classification and product filters False otherwise |