17 lines
589 B
C#
17 lines
589 B
C#
using RecNet.Application.Common.Interfaces;
|
|
using RecNet.Domain.Profiles.Names;
|
|
|
|
namespace RecNet.Application.Profiles.Login;
|
|
|
|
public class NameGenerator(IConfigService configService)
|
|
{
|
|
public async Task<string> GenerateAsync(CancellationToken ct = default)
|
|
{
|
|
var config = await configService.GetAsync("Profiles:NameGen", DefaultNameGenConfig.Value, ct);
|
|
|
|
var adjective = config.Adjectives[Random.Shared.Next(config.Adjectives.Count)];
|
|
var noun = config.Nouns[Random.Shared.Next(config.Nouns.Count)];
|
|
|
|
return $"{adjective}{noun}";
|
|
}
|
|
} |