mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-10-15 01:54:43 +00:00
Update XML doc comment in backend projects
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Infrastructure.Email.Templates.Rendering;
|
||||
public class EmailTemplateProvider(IServiceProvider serviceProvider, ILoggerFactory loggerFactory)
|
||||
: IEmailTemplateProvider
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public async Task<string> RenderUserRegisteredEmailAsync(
|
||||
string username,
|
||||
string confirmationLink
|
||||
@@ -26,6 +27,7 @@ public class EmailTemplateProvider(IServiceProvider serviceProvider, ILoggerFact
|
||||
return await RenderComponentAsync<UserRegistration>(parameters);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<string> RenderResendConfirmationEmailAsync(
|
||||
string username,
|
||||
string confirmationLink
|
||||
|
||||
@@ -5,13 +5,15 @@ namespace Infrastructure.Email.Templates.Rendering;
|
||||
/// </summary>
|
||||
public interface IEmailTemplateProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders the UserRegisteredEmail template.
|
||||
/// </summary>
|
||||
/// <summary>Renders the registration confirmation email template.</summary>
|
||||
/// <param name="username">The recipient's username, shown in the greeting.</param>
|
||||
/// <param name="confirmationLink">The URL the recipient follows to confirm their account.</param>
|
||||
/// <returns>A task whose result is the rendered HTML for the email body.</returns>
|
||||
Task<string> RenderUserRegisteredEmailAsync(string username, string confirmationLink);
|
||||
|
||||
/// <summary>
|
||||
/// Renders the ResendConfirmation template.
|
||||
/// </summary>
|
||||
/// <summary>Renders the resend-confirmation email template.</summary>
|
||||
/// <param name="username">The recipient's username, shown in the greeting.</param>
|
||||
/// <param name="confirmationLink">The URL the recipient follows to confirm their account.</param>
|
||||
/// <returns>A task whose result is the rendered HTML for the email body.</returns>
|
||||
Task<string> RenderResendConfirmationEmailAsync(string username, string confirmationLink);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,17 @@ namespace Infrastructure.Email;
|
||||
/// </summary>
|
||||
public interface IEmailProvider
|
||||
{
|
||||
/// <summary>Sends an email to a single recipient.</summary>
|
||||
/// <param name="to">The recipient's email address.</param>
|
||||
/// <param name="subject">The email subject line.</param>
|
||||
/// <param name="body">The email body content.</param>
|
||||
/// <param name="isHtml">Whether <paramref name="body"/> is HTML; when <see langword="false"/> it is sent as plain text.</param>
|
||||
Task SendAsync(string to, string subject, string body, bool isHtml = true);
|
||||
|
||||
/// <summary>Sends an email to multiple recipients.</summary>
|
||||
/// <param name="to">The recipients' email addresses.</param>
|
||||
/// <param name="subject">The email subject line.</param>
|
||||
/// <param name="body">The email body content.</param>
|
||||
/// <param name="isHtml">Whether <paramref name="body"/> is HTML; when <see langword="false"/> it is sent as plain text.</param>
|
||||
Task SendAsync(IEnumerable<string> to, string subject, string body, bool isHtml = true);
|
||||
}
|
||||
|
||||
@@ -51,15 +51,17 @@ public class SmtpEmailProvider : IEmailProvider
|
||||
_fromName = Environment.GetEnvironmentVariable("SMTP_FROM_NAME") ?? "The Biergarten";
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task SendAsync(string to, string subject, string body, bool isHtml = true)
|
||||
{
|
||||
await SendAsync([to], subject, body, isHtml);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <inheritdoc/>
|
||||
/// <remarks>
|
||||
/// Connects using StartTls when SSL is enabled (or no encryption otherwise), authenticates
|
||||
/// if credentials were configured, sends the message, and disconnects.
|
||||
/// </summary>
|
||||
/// </remarks>
|
||||
/// <exception cref="InvalidOperationException">
|
||||
/// Thrown when connecting, authenticating, or sending via SMTP fails, wrapping the original exception.
|
||||
/// </exception>
|
||||
|
||||
@@ -2,8 +2,11 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Infrastructure.Sql.DependencyInjection;
|
||||
|
||||
/// <summary>Extension methods for registering SQL infrastructure services with dependency injection.</summary>
|
||||
public static class InfrastructureSqlServiceCollectionExtensions
|
||||
{
|
||||
/// <summary>Registers <see cref="DefaultSqlConnectionFactory" /> as a singleton <see cref="ISqlConnectionFactory" />.</summary>
|
||||
/// <returns>The same <paramref name="services" /> instance, for chaining.</returns>
|
||||
public static IServiceCollection AddInfrastructureSql(this IServiceCollection services)
|
||||
{
|
||||
services.AddSingleton<ISqlConnectionFactory, DefaultSqlConnectionFactory>();
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
namespace Infrastructure.Sql;
|
||||
|
||||
/// <summary>
|
||||
/// Custom SQL Server error numbers (50000+) that this application's stored procedures use to
|
||||
/// signal domain-level failures via <c>THROW</c>. Repositories catch
|
||||
/// <see cref="Microsoft.Data.SqlClient.SqlException" /> and switch on <c>ex.Number</c> against
|
||||
/// these constants to translate the failure into the corresponding <c>Domain.Exceptions</c> type.
|
||||
/// Custom SQL Server error numbers (50000+) that a stored procedure could use to signal
|
||||
/// domain-level failures via <c>THROW</c>, for a repository to catch as
|
||||
/// <see cref="Microsoft.Data.SqlClient.SqlException" /> and translate via <c>ex.Number</c> into
|
||||
/// the corresponding <c>Domain.Exceptions</c> type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Each number is shared by every procedure that raises that category of error — it identifies
|
||||
/// the category, not a single call site. The procedure's own error message (<c>ex.Message</c>)
|
||||
/// already says which entity or rule was involved, so it is safe to surface directly to callers.
|
||||
/// Currently unused: the schema has no stored procedures, and no repository throws or catches on
|
||||
/// these numbers. Repositories instead run their own existence/concurrency checks and throw
|
||||
/// <c>Domain.Exceptions</c> directly (see <c>docs/website/database.md</c> for the current
|
||||
/// approach). This type is kept in case a future stored procedure reintroduces the pattern; each
|
||||
/// number would
|
||||
/// identify a category of error shared by every procedure that raises it, not a single call site.
|
||||
/// </remarks>
|
||||
public static class SqlErrorCodes
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user