Skip to content
Discussion options

You must be logged in to vote

C# 9.0 Source generators should make it possible to write something like this:

public partial class MyCompositeClass
{
  [ImplementInterface]
  protected IComposite1 _composite1;
    
  [ImplementInterface(typeof(IComposite2))]
  private Composite2Impl _composite2;
  
  public MyCompositeClass(IComposite1 composite1)
  {
    _composite1 = composite1;
    _composite2 = new Composite2Impl();
  }
}

and have the source generator generate the rest.

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@bigpilot
Comment options

Answer selected by YairHalberstadt
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #2017 on October 19, 2020 11:33.