Skip to content

Overriding method name using HubMethodNameAttribute #102

@alefcarlos

Description

@alefcarlos

Hey! This is a great project !

It would be cool if the HubMethodNameAttribute is applied replace the methodName on jsonSpec.

[Authorize]
public class TrackingsHub : Hub<ITrackingsClientContract>, ITrackingsHub
{
    [HubMethodName("subscribe-pusher")]
    public async Task<ReplyPayload> SubscribePushersAsync(SubscribeOptions options)
    {
       .....
    }
}
[
    {
        "name": "TrackingsHub",
        "path": "/hubs/trackings",
        "isAuthRequired": true,
        "hubType": {
            "interfaceName": "ITrackingsHub",
            "interfaceFullName": "global::Hbsa.Navigation.Tracker.Hubs.Client.ITrackingsHub",
            "collisionFreeName": "global__Hbsa_Navigation_Tracker_Hubs_Client_ITrackingsHub",
            "methods": [
                {
                    "methodName": "subscribe-pusher", 👈Here
                    "returnType": "global::System.Threading.Tasks.Task<global::Hbsa.Navigation.Tracker.Hubs.Client.Contracts.ReplyPayload>",
                    "isGenericReturnType": true,
                    "genericReturnTypeArgument": "global::Hbsa.Navigation.Tracker.Hubs.Client.Contracts.ReplyPayload",
                    "parameters": [
                        {
                            "name": "options",
                            "typeName": "global::Hbsa.Navigation.Tracker.Hubs.Client.SubscribeOptions"
                        }
                    ]
                },
            ]
        }
    }
]

If you accept I could help with a PR ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions