Skip to content

DTO Instantiation

stepaside edited this page Jul 28, 2012 · 3 revisions
ICustomer instance
var created = ObjectFactory.Create<ICustomer>();
Customer instance
// This is obvious
var created = new Customer();
// However ObjectFactory.Create can be used with classes as well
var created = ObjectFactory.Create<Customer>();
// This is generally faster than Activator.CreateInstance<Customer>()

Clone this wiki locally