Need to add InterfaceBuildMember
Closed this issue · 3 comments
dgauerke commented
I was in need of creating a namespace with multiple interfaces and classes. The class builder was supported, but not the interface. Here is the code I added
public class InterfaceBuildMember : IBuildMember
{
private readonly TypeDeclarationSyntax _interface;
public InterfaceBuildMember(InterfaceBuilder interfaceBuilder)
{
_interface = interfaceBuilder.BuildWithoutNamespace();
}
public InterfaceBuildMember(TypeDeclarationSyntax @interface)
{
_interface = @interface;
}
public SyntaxList<MemberDeclarationSyntax> AddMember(SyntaxList<MemberDeclarationSyntax> members)
{
return members.Add(_interface);
}
}
MilleBo commented
Oh I must have missed that! Could you create a pull request with this code (and maybe a unit test?) so we can add it to the next release?
dgauerke commented
I haven’t done that before, but I’ll give it a shot.
From: Mille Boström [mailto:notifications@github.com]
Sent: Tuesday, March 24, 2020 1:15 PM
To: Testura/Testura.Code <Testura.Code@noreply.github.com>
Cc: David <dgauerke@new.rr.com>; Author <author@noreply.github.com>
Subject: Re: [Testura/Testura.Code] Need to add InterfaceBuildMember (#63)
Oh I must have missed that! Could you create a pull request with this code (and maybe a unit test?) so we can add it to the next release?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#63 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ADZYRZHAKT3UCIXUUM2NC6LRJD2AXANCNFSM4LS4CVQQ>.
MilleBo commented
This have now been added to the code base and will be included in next nuget update.