Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for abstract classes and methods #28

Closed
MichaelHochriegl opened this issue Feb 3, 2022 · 0 comments · Fixed by #29
Closed

Add support for abstract classes and methods #28

MichaelHochriegl opened this issue Feb 3, 2022 · 0 comments · Fixed by #29

Comments

@MichaelHochriegl
Copy link
Contributor

It would be nice to be able to make abstract classes and methods. Currently only virtual is supported.

My Fluent-API would look like this:

var builder = CodeBuilder.Create("AwesomeApp")
                .AddClass("SampleClass")
                .MakeAbstractClass()
                .AddMethod("MyAbstractMethod")
                .MakeAbstract()
                .Class;

These should produce an output like:

namespace AwesomeApp
{
    abstract partial class SampleClass
    {
        abstract void MyAbstractMethod()
        {
        }
    }
}

I've got a pull request ready for this, but am of course open for changes to this. My approach follows the virtual style to be consistent.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant