0

I have the following lambda expression:

Something((o, i) => new TheNewSwiss(o, i));

Is there a shorthand syntax? Something simliar to this but for ctors?

Something((o, i) => TheNewSwiss.New(o,i));
Something(TheNewSwiss.New);
Romano Zumbé
  • 7,893
  • 4
  • 33
  • 55
Paul Nikonowicz
  • 3,883
  • 21
  • 39

1 Answers1

4

No, there's no equivalent of method group conversions for constructors. (I can see it being handy, but it doesn't exist.) You just need to use the lambda expression syntax you've got in your first snippet.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194