26 instantiations of PersistentPortAllocationKey
Aspire.Hosting (3)
Dcp\DcpExecutor.cs (1)
825return new PersistentPortAllocationKey(resource.Name, endpoint.Name);
Dcp\PersistentPortAllocationStore.cs (1)
99allocations[new PersistentPortAllocationKey(resource.Key, endpoint.Key)] = publicPort;
Dcp\PersistentPortAllocator.cs (1)
142var publicPortKey = new PersistentPortAllocationKey(resource.Name, endpoint.Name);
Aspire.Hosting.Tests (23)
Dcp\AppHostLocalStateStoreTests.cs (11)
25var firstKey = new PersistentPortAllocationKey("first", "http"); 26var secondKey = new PersistentPortAllocationKey("second", "http"); 53store.SetPort(new PersistentPortAllocationKey("Program", "HTTP"), 12001); 55var equivalentKey = new PersistentPortAllocationKey("program", "http"); 82portAllocationStore.SetPort(new PersistentPortAllocationKey("first", "http"), 12001); 92portAllocationStore.SetPort(new PersistentPortAllocationKey("second", "http"), 12002); 116portAllocationStore.SetPort(new PersistentPortAllocationKey("first", "http"), 12001); 141portAllocationStore.SetPort(new PersistentPortAllocationKey("first", "http"), 12001); 169var key = new PersistentPortAllocationKey("program", "http"); 185var firstKey = new PersistentPortAllocationKey("first", "http"); 186var secondKey = new PersistentPortAllocationKey("second", "http");
Dcp\DcpExecutorTests.cs (12)
1656Assert.Equal(allocatedPort, allocations[new PersistentPortAllocationKey("CoolProgram", "http")]); 1700Assert.Equal(allocatedPort, allocations[new PersistentPortAllocationKey("database", "http")]); 1896Assert.Equal(persistedPort, allocations[new PersistentPortAllocationKey("PersistentProgram", "http")]); 1897Assert.Equal(allocatedPort, allocations[new PersistentPortAllocationKey("DynamicProgram", "http")]); 1911var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 1963var storedPortKey = new PersistentPortAllocationKey("StoredProgram", "http"); 2010var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 2061var portKey = new PersistentPortAllocationKey("Program", "http"); 2123new PersistentPortAllocationKey("FixedProgram", "http"), 2206var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 2253var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 2341Assert.Equal(new PersistentPortAllocationKey("Program", "http"), allocation.Key);
27 references to PersistentPortAllocationKey
Aspire.Hosting (15)
Dcp\DcpExecutor.cs (3)
687var portKey = GetPersistentPublicPortKey(sp.ModelResource, endpoint); 810var portKey = GetPersistentPublicPortKey(resource, endpoint); 823private static PersistentPortAllocationKey GetPersistentPublicPortKey(IResource resource, EndpointAnnotation endpoint)
Dcp\PersistentPortAllocationStore.cs (6)
19public IReadOnlyDictionary<PersistentPortAllocationKey, int> GetAllocations() 24new Dictionary<PersistentPortAllocationKey, int>()); 27public void SetPort(PersistentPortAllocationKey key, int port) 48out Dictionary<PersistentPortAllocationKey, int> allocations) 120private static JsonObject WritePortAllocations(Dictionary<PersistentPortAllocationKey, int> allocations) 152public bool Equals(PersistentPortAllocationKey other) =>
Dcp\PersistentPortAllocator.cs (6)
22private readonly Dictionary<PersistentPortAllocationKey, int> _reservedPorts = new(); 43public int GetOrAllocatePersistentPort(PersistentPortAllocationKey key, ProtocolType protocol) 74private int? GetLegacyPort(PersistentPortAllocationKey key) 105private static string GetLegacyConfigurationKey(PersistentPortAllocationKey key) 117var activePortKeys = new Dictionary<PersistentPortAllocationKey, ActivePort>(); 142var publicPortKey = new PersistentPortAllocationKey(resource.Name, endpoint.Name);
Aspire.Hosting.Tests (12)
Dcp\AppHostLocalStateStoreTests.cs (6)
25var firstKey = new PersistentPortAllocationKey("first", "http"); 26var secondKey = new PersistentPortAllocationKey("second", "http"); 55var equivalentKey = new PersistentPortAllocationKey("program", "http"); 169var key = new PersistentPortAllocationKey("program", "http"); 185var firstKey = new PersistentPortAllocationKey("first", "http"); 186var secondKey = new PersistentPortAllocationKey("second", "http");
Dcp\DcpExecutorTests.cs (6)
1911var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 1963var storedPortKey = new PersistentPortAllocationKey("StoredProgram", "http"); 2010var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 2061var portKey = new PersistentPortAllocationKey("Program", "http"); 2206var portKey = new PersistentPortAllocationKey("PersistentProgram", "http"); 2253var portKey = new PersistentPortAllocationKey("PersistentProgram", "http");