I'm currently working through some old code and I started to wonder, is there actually any difference between:
public class XmlExport : IXmlExport
{
private readonly IJobRepository jobRepository = new JobRepository();
}
and
public class XmlExport : IXmlExport
{
private readonly IJobRepository jobRepository;
public XmlExport()
{
jobRepository = new JobRepository();
}
}
Are there any advantages to initializing inside the constructor? or is it just the same code?