Skip to content

Complete example of adding custom Operation #3138

Answered by gojanpaolo
gojanpaolo asked this question in Q&A
Discussion options

You must be logged in to vote

I think I got it.. What's missing was Type<StringType>().Extend().OnBeforeCreate(_ => _.Handler = ...) to fully configure the custom operation.

public static class CustomOperations
{
    public const int Like = 1025;
}

public class CustomFilteringConvention : FilterConvention
{
    protected override void Configure(IFilterConventionDescriptor descriptor)
    {
        descriptor.AddDefaults();
        descriptor
            .Operation(CustomOperations.Like)
            .Name("like");
        descriptor
            .Configure<StringOperationFilterInputType>(_ => _
                .Operation(CustomOperations.Like)
                .Type<StringType>()
                .Extend()
                .

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@PascalSenn
Comment options

@gojanpaolo
Comment options

Answer selected by gojanpaolo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants