Show / Hide Table of Contents

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
System.Object
UpstreamSourceFilter
Implements
IMetadataFilter
Namespace: Microsoft.PackageGraph.MicrosoftUpdate.Source
Assembly: package-graph-microsoftupdate-source.dll
Syntax
public class UpstreamSourceFilter : IMetadataFilter

Constructors

| Improve this Doc View Source

UpstreamSourceFilter()

Creates an empty filter.

Declaration
[JsonConstructor]
public UpstreamSourceFilter()
| Improve this Doc View Source

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 Source

ClassificationsFilter

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.

| Improve this Doc View Source

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 Source

Apply(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

| Improve this Doc View Source

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
System.Object.Equals(System.Object)
| Improve this Doc View Source

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
System.Object.GetHashCode()

Operators

| Improve this Doc View Source

Equality(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

| Improve this Doc View Source

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

Implements

IMetadataFilter
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX