📄 StackExchangeOptions.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Options;

namespace MSearch.SearchProviders.StackExchange;

internal sealed class StackExchangeOptions
{
    [Required]
    public required string ApiKey { get; set; }

    [Required]
    public required string Site { get; set; }
}

[OptionsValidator]
internal sealed partial class StackExchangeOptionsValidator : IValidateOptions<StackExchangeOptions>;