It helps to note I'm very new to c#.
But consider the following class:
class AllItems
{
private readonly Database database;
public AllItems(Database database)
{
this.database = database;
}
}
I have the following questions:
In the above example we are assigning
private readonly Database database
the value which gets passed intoAllItems
class, is that correct?Would it matter if I swapped
this.database = database
around, so it looked likedatabase = this.database
instead?Where we are saying
this.database
, doesthis
refer to the database inAllItems(Database database)
or does it refer toprivate readonly Database database
?