0
respostas

[Resolução] Com switch expression

public Avaliacao(int nota)
{
    Nota = nota switch
    {
        < 0 => 0,
        > 10 => 10,
        _ => nota
    };
}