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 databasethe value which gets passed intoAllItemsclass, is that correct?Would it matter if I swapped
this.database = databasearound, so it looked likedatabase = this.databaseinstead?Where we are saying
this.database, doesthisrefer to the database inAllItems(Database database)or does it refer toprivate readonly Database database?