Table of Contents

Class ResourceContext

Namespace
Fabricator.Core
Assembly
Fabricator.Core.dll

The context of a resource check or application.

[CompilationMapping(SourceConstructFlags.RecordType)]
public sealed class ResourceContext : IEquatable<ResourceContext>, IStructuralEquatable
Inheritance
ResourceContext
Implements
Inherited Members

Constructors

ResourceContext(IReporter, IReadOnlyDictionary<SecretRef, SecureString>)

[DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields|DynamicallyAccessedMemberTypes.NonPublicFields|DynamicallyAccessedMemberTypes.PublicProperties|DynamicallyAccessedMemberTypes.NonPublicProperties, typeof(ResourceContext))]
public ResourceContext(IReporter reporter, IReadOnlyDictionary<SecretRef, SecureString> secrets)

Parameters

reporter IReporter
secrets IReadOnlyDictionary<SecretRef, SecureString>

Properties

Reporter

The reporter of the status, progress, and log of the operation.

[CompilationMapping(SourceConstructFlags.Field, 0)]
public IReporter Reporter { get; }

Property Value

IReporter

Secrets

The secrets required by the operation (see Secrets): for a check, the ones requested in CheckOnly and CheckAndApply modes; for an application, the ones requested in ApplyOnly and CheckAndApply modes.

[CompilationMapping(SourceConstructFlags.Field, 1)]
public IReadOnlyDictionary<SecretRef, SecureString> Secrets { get; }

Property Value

IReadOnlyDictionary<SecretRef, SecureString>

Remarks

The secrets are fetched from their stores right before the operation starts, and are disposed right after it finishes. Every string is only valid for this operation: don't keep it after the operation has finished.

The operation is encouraged to dispose every string as soon as it is not needed anymore, even if the operation itself is not finished yet (disposing a string several times is safe).

Note that SecureString provides little actual protection: it is mostly used to indicate that the string should be treated carefully, and to allow cleaning it up from the memory as soon as possible.

Methods

Equals(ResourceContext)

public override sealed bool Equals(ResourceContext obj)

Parameters

obj ResourceContext

Returns

bool

Equals(ResourceContext, IEqualityComparer)

public bool Equals(ResourceContext obj, IEqualityComparer comp)

Parameters

obj ResourceContext
comp IEqualityComparer

Returns

bool

Equals(object?)

public override sealed bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(object?, IEqualityComparer)

public override sealed bool Equals(object? obj, IEqualityComparer comp)

Parameters

obj object
comp IEqualityComparer

Returns

bool

GetHashCode()

public override sealed int GetHashCode()

Returns

int

GetHashCode(IEqualityComparer)

public override sealed int GetHashCode(IEqualityComparer comp)

Parameters

comp IEqualityComparer

Returns

int

ToString()

public override string ToString()

Returns

string