Files
TenWholeYears.Server/RecNet.Application/Profiles/NameGenerator.cs
2026-06-19 15:12:04 -05:00

17 lines
583 B
C#

using RecNet.Application.Common.Interfaces;
using RecNet.Domain.Profiles.Names;
namespace RecNet.Application.Profiles;
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}";
}
}