JamesRandall / FunctionMonkey

Write more elegant Azure Functions with less boilerplate, more consistency, and support for REST APIs. Docs can be found at https://functionmonkey.azurefromthetrenches.com
MIT License
294 stars 50 forks source link

Compilation fails with nested command #145

Open cocowalla opened 4 years ago

cocowalla commented 4 years ago

I like to arrange things into feature folders (which is a popular way of doing things with Mediatr too), such as:

+ Features
  + Widgets
    - Get.cs
    - Delete.cs
    - Put.cs
  + Fidgets
    - ...

Get.cs looks a bit like:

namespace Acme.Features.Widgets
{
    public class Get
    {
        public class Command: ICommand<string>
        {
            // ...
        }

        public class CommandHandler : ICommandHandler<Command, string>
        {
            // ...
        }
    }
}

However, when trying to build I get:

FunctionMonkey.Compiler.targets(29, 5): Command Acme.Features.Widgets.Get+Command must be public

As you can see, the nested classes in question are public.

andrewdmoreno commented 4 years ago

@cocowalla I ran into this yesterday as well. It's a common structure that is used often with Mediatr so for my initial exploration of the integration with FunctionMonkey I started with that approach as well. Worked around it for now but agreed that would be great to have resolved.