次のようなクラスを見つけました。
class Controller
{
private readonly IDataContext _myContext = new DataContext("connectionstring");
public Controller(IDataContext context){
_myContext = context;
}
}
与えられたインスタンスは以下のように作成されます:
var controller = new Controller(new DataContext("anotherconnectionstring"));
私が知りたいのは、どれが _myContext フィールドに割り当てられる最終インスタンスになるかということです? 引数として渡されたもの、または宣言で RHS として使用されたもの?