54 references to Model
Aspire.Hosting.Native.Core.Tests (4)
DeclarativeApplicationTests.cs (1)
142
var snapshot = composition.
Model
.ReadResource(resource.Handle);
MilestoneDependencyTests.cs (1)
27
WorkloadExecutionPlan.Validate(composition.
Model
.Inspect().Resources, allocationBeforeStart: true);
NativeModelAlignmentTests.cs (2)
26
var snapshot = composition.
Model
.ReadResource(workload.Handle);
95
Assert.Empty(composition.
Model
.Inspect().SecretParameters);
Aspire.Hosting.Native.Server (50)
Api\ApplicationWorkspace.cs (6)
77
revision.
Model
.Dispose();
87
using var operation = new NativeDiagnostics.Operation("runtime.revision.commit", null, revision.
Model
.GenerationId, invitations.Options.TimeProvider);
92
var declarations = revision.
Model
.Seal();
111
_committed?.
Model
.Dispose();
179
_pending?.
Model
.Dispose();
182
_committed?.
Model
.Dispose();
Api\CompositionApi.cs (14)
64
_session.RetireGeneration(composition.
Model
.GenerationId);
182
public DeclaredResource AddResource(string name, string typeId) => new(this,
Model
.AddResource(name, typeId));
188
public DeclaredValue CreateLiteralValue(string value) => new(this, SymbolicValue.Literal(
Model
.GenerationId, value));
195
public DeclaredValue AddSecretParameter(string name, string value) => new(this,
Model
.AddSecretParameter(name, value));
200
new(this,
Model
.AddSecretParameter(name, System.Security.Cryptography.RandomNumberGenerator.GetHexString(64)));
229
public CompositionSnapshot Inspect() => Copy(
Model
.Inspect());
233
public CompositionSnapshot Seal() => Copy(
Model
.Seal());
258
Composition.
Model
.AddDependency(Handle, dependency.Handle);
263
public DeclarationSnapshot InspectResource() => Copy(Composition.
Model
.ReadResource(Handle));
280
Composition.
Model
.SetConfiguration(Handle, properties.Select(property =>
294
Composition.
Model
.SetSymbolicConfiguration(Handle, name, value.Value);
299
public void RemoveSymbolicConfiguration(string name) => Composition.
Model
.RemoveSymbolicConfiguration(Handle, name);
304
CopySymbolic(Composition.
Model
.ReadResource(Handle).SymbolicConfiguration);
338
composition.
Model
.ValidateValue(value);
Api\ComputeEnvironmentApi.cs (2)
10
public DeclaredResource AddComputeEnvironment(string name, string typeId) => new(this,
Model
.AddComputeEnvironment(name, typeId));
23
Composition.
Model
.SetComputeEnvironment(Handle, environment.Handle);
Api\DeclarativeWorkloadApi.cs (10)
18
Model
.SetWorkload(resource.Handle, plan);
29
Model
.SetWorkload(resource.Handle, plan);
58
Composition.
Model
.MutateWorkload(Handle, current =>
88
Composition.
Model
.MutateWorkload(Handle, current =>
110
Composition.
Model
.MutateWorkload(Handle, current =>
132
Composition.
Model
.MutateWorkload(Handle, current =>
155
Composition.
Model
.MutateWorkload(Handle, current =>
172
Composition.
Model
.MutateWorkload(Handle, current =>
191
Composition.
Model
.MutateWorkload(Handle, current =>
219
Composition.
Model
.MutateWorkload(Handle, current => (current with
Api\ParameterApi.cs (7)
17
return new(this,
Model
.AddUnboundParameter(name, secret));
23
return new(this, secret ?
Model
.AddSecretParameter(name, value) :
Model
.AddParameter(name, value, false));
35
return new(this, secret ?
Model
.AddSecretParameter(name, value) :
Model
.AddParameter(name, value, publishValueAsDefault));
88
return new(this, secret ?
Model
.AddSecretParameter(name, value) :
Model
.AddParameter(name, value, false));
Api\PublishingApi.cs (1)
17
var snapshot =
Model
.Seal();
Api\RpcAuthoringApi.cs (6)
155
Owner.Composition.
Model
.MutateWorkload(Resource.Handle, current =>
206
var configuration = Owner.Composition.
Model
.ReadResource(Resource.Handle).Configuration;
207
Owner.Composition.
Model
.SetConfiguration(Resource.Handle, configuration.Where(entry => entry.Name != key)
219
return Owner.Composition.
Model
.ReadResource(Resource.Handle).Configuration
249
source.Owner.Composition.
Model
.ReadResource(source.Resource.Handle).SymbolicConfiguration
286
var endpoint = composition.
Model
.ReadResource(resource.Resource.Handle).Workload?.Plan.Endpoints
Api\RuntimeApi.cs (3)
81
Runtime = new RuntimeGeneration(composition.
Model
.Seal(), invitations.Executor, invitations.Options);
102
var declaration = resource.Composition.
Model
.ReadResource(resource.Handle);
128
var declaration = resource.Composition.
Model
.ReadResource(resource.Handle);
Rpc\NativeProviderLifecycle.cs (1)
36
declaration.Composition.
Model
.SetProviderLifecycle(declaration.Handle, bindings);