Skip to content

Reduce flow boilerplate by introducing an abstract class ontop of IFlow #6

Description

@catmanjan

Hello cool project, I was just looking at the quickstart and it would be nice if ConfigureAsync was optional, instead you could have an abstract class e.g. BasicFlow which implements its own ConfigureAsync based on the name of the implementing class, something like this:

using DidactCore.Flows;
using DidactCore.Constants;

public abstract class BasicFlow : IFlow
{
    private readonly IFlowConfigurator _flowConfigurator;

    public BasicFlow(IFlowConfigurator flowConfigurator)
    {
        _flowConfigurator = flowConfigurator;
    }

    public async Task ConfigureAsync()
    {
        await _flowConfigurator
            .WithTypeName(GetType().Name)
            .WithName(Assembly.GetExecutingAssembly().Name)
            .WithDescription(Assembly.GetExecutingAssembly().Name)
            .AsVersion(Assembly.GetExecutingAssembly().Version)
            .ForQueue(QueueTypes.HyperQueue, "Default")
            .SaveConfigurationsAsync();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions