Skip to content

Commit 1104b48

Browse files
authored
Update docs to use EndpointProperty.HostAndPort where appropriate (#2934)
Fixes #2646
1 parent fc77a73 commit 1104b48

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

docs/extensibility/custom-hosting-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ For example, the `MailDevResource` exposes a property called `ConnectionStringEx
357357
```csharp
358358
public ReferenceExpression ConnectionStringExpression =>
359359
ReferenceExpression.Create(
360-
$"smtp://{SmtpEndpoint.Property(EndpointProperty.Host)}:{SmtpEndpoint.Property(EndpointProperty.Port)}"
360+
$"smtp://{SmtpEndpoint.Property(EndpointProperty.HostAndPort)}"
361361
);
362362
```
363363

docs/extensibility/snippets/MailDevResource/MailDev.Hosting/MailDevResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public sealed class MailDevResource(string name) : ContainerResource(name), IRes
2525
// the connection string is composed of the SmtpEndpoint endpoint reference.
2626
public ReferenceExpression ConnectionStringExpression =>
2727
ReferenceExpression.Create(
28-
$"smtp://{SmtpEndpoint.Property(EndpointProperty.Host)}:{SmtpEndpoint.Property(EndpointProperty.Port)}"
28+
$"smtp://{SmtpEndpoint.Property(EndpointProperty.HostAndPort)}"
2929
);
3030
}

docs/extensibility/snippets/MailDevResourceAndComponent/MailDev.Hosting/MailDevResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ public sealed class MailDevResource(string name) : ContainerResource(name), IRes
2525
// the connection string is composed of the SmtpEndpoint endpoint reference.
2626
public ReferenceExpression ConnectionStringExpression =>
2727
ReferenceExpression.Create(
28-
$"smtp://{SmtpEndpoint.Property(EndpointProperty.Host)}:{SmtpEndpoint.Property(EndpointProperty.Port)}"
28+
$"smtp://{SmtpEndpoint.Property(EndpointProperty.HostAndPort)}"
2929
);
3030
}

docs/extensibility/snippets/MailDevResourceWithCredentials/MailDev.Hosting/MailDevResource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ UsernameParameter is not null ?
4545
// the connection string is composed of the SmtpEndpoint endpoint reference.
4646
public ReferenceExpression ConnectionStringExpression =>
4747
ReferenceExpression.Create(
48-
$"Endpoint=smtp://{SmtpEndpoint.Property(EndpointProperty.Host)}:{SmtpEndpoint.Property(EndpointProperty.Port)};Username={UserNameReference};Password={PasswordParameter}"
48+
$"Endpoint=smtp://{SmtpEndpoint.Property(EndpointProperty.HostAndPort))};Username={UserNameReference};Password={PasswordParameter}"
4949
);
5050
}

0 commit comments

Comments
 (0)