is there some way to autogenerate the obvious 2-param constructor for this class in visual studio?
class Thing {
public readonly string a;
public readonly Object b;
}
I guess you’re supposed to use the:
new Thing { a = ..., b = ... }
syntax in such cases, but that won’t work with readonly fields as above. Another plus of having a constructor is that you can’t forget a field.
There is, Resharper supports this functionality. You choose the “generate constructor”, pick the fields you want included and you’ve got your constructor.