What does “_id” mean in this line of code? [closed]

He is just naming the variables differently for ease of reading / understanding. What he does is, declaring a property of type T (generic type) with name id and accepting a value for that in the constructor using the variable _id also of type T. and assigning it to the id proprty. this can also be writter as below but for clarity of reading the above approach may be good.

class Account<T>
{

    public T id { get; set; }
    public int Sum { get; set; }

    public Account(T id)
    {
        this.id = id;
    }
}

Leave a Comment