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
reporterIReportersecretsIReadOnlyDictionary<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
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
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
objResourceContext
Returns
Equals(ResourceContext, IEqualityComparer)
public bool Equals(ResourceContext obj, IEqualityComparer comp)
Parameters
objResourceContextcompIEqualityComparer
Returns
Equals(object?)
public override sealed bool Equals(object? obj)
Parameters
objobject
Returns
Equals(object?, IEqualityComparer)
public override sealed bool Equals(object? obj, IEqualityComparer comp)
Parameters
objobjectcompIEqualityComparer
Returns
GetHashCode()
public override sealed int GetHashCode()
Returns
GetHashCode(IEqualityComparer)
public override sealed int GetHashCode(IEqualityComparer comp)
Parameters
compIEqualityComparer
Returns
ToString()
public override string ToString()