Time and Date
Time and Date Abstractions in RCommon
Configuration
builder.Services.AddRCommon()
.WithDateTimeSystem(dateTime => dateTime.Kind = DateTimeKind.Utc)Implementation
public class CreateLighthouseProfileCommandHandler : IAppRequestHandler<CreateLighthouseProfileCommand, LighthouseProfileResponse>
{
private readonly ISystemTime _systemTime;
public CreateLighthouseProfileCommandHandler(ISystemTime systemTime)
{
_systemTime = systemTime;
}
public async Task<LighthouseProfileResponse> HandleAsync(CreateLighthouseProfileCommand request, CancellationToken cancellationToken)
{
LighthouseProfile profile = new LighthouseProfile(_systemTime.Now, request.WebsiteUrl, request.CreatedByEmail);Last updated