Can I avoid initializing this?
I have a simple factory with no constructor. I use it like this:
var slf = new GenericSelectListFactory();
vm.Works = slf.getWorkgsl(0);
vm.Cars = slf.getCargsl(0);
I can also use it like this:
vm.Cars = new GenericSelectListFactory().getCargsl(0);
Is there any way to use it without the new keyword?
vm.Cars = GenericSelectListFactory.getCargsl(0);
Make the method of your class static.