mirror of
https://github.com/fiodarsazanavets/aspire-13-examples.git
synced 2026-06-20 12:23:14 +00:00
22 lines
678 B
C#
22 lines
678 B
C#
using Aspire.Hosting.ApplicationModel;
|
|
|
|
namespace OnlineShop.MailDev.Hosting;
|
|
|
|
public sealed class MailDevResource(string name) :
|
|
ContainerResource(name), IResourceWithConnectionString
|
|
{
|
|
internal const string SmtpEndpointName = "smtp";
|
|
internal const string HttpEndpointName = "http";
|
|
|
|
private EndpointReference? _smtpReference;
|
|
|
|
public EndpointReference SmtpEndpoint =>
|
|
_smtpReference ??= new(this, SmtpEndpointName);
|
|
|
|
public ReferenceExpression ConnectionStringExpression =>
|
|
ReferenceExpression.Create(
|
|
$"smtp://{SmtpEndpoint.Property(EndpointProperty.Host)}:{SmtpEndpoint.Property(EndpointProperty.Port)}"
|
|
);
|
|
}
|
|
|