esssential

u/esssential







r/csharp•

Is something like this the best way of inheriting from non-generic classes?

public abstract class Answer
{
    private readonly Question _question;
    public Question Question => _question;

    protected Answer(Question question)
        => _question = question;
}

public abstract class Answer<TQuestion> : Answer
    where TQuestion : Question
{
    private readonly TQuestion _question;
    public new TQuestion Question => _question;

    protected Answer(TQuestion question) : base(question)
        => _question = question;
}

public class SingleAnswer : Answer<SingleOptionQuestion>
{
    priva
810




r/SVExchange•

1679

TSV

[tsv]

MY INFORMATION:

  • FC: 2896-0836-0425

  • IGN: Kaj (ΩR)

  • Language: English

  • Time Zone: EDT (UTC -4)

  • I'm generally working during the day

PLEASE INCLUDE:

  • FC:

  • IGN:

  • Prehatched(Y/N)?

  • Pokemon:

  • Nickname:

I am very new to this, so please have some patience with me.

Happy hatching.

136