public static ControllerEndpointSettings AuthorizeAction(this ControllerEndpointSettings controller,
                                                          string actionMethodName, AuthorizationCategory category, string policy = null)
 {
     controller.ActionSettingsCollection.FirstOrDefault(x => x.ActionMethod
                                                        .EndsWith(actionMethodName, StringComparison.OrdinalIgnoreCase))
     .Authorize(category, policy);
     return(controller);
 }
        //public static ActionEndpointSettings Action(this ControllerEndpointSettings controller, string actionMethodName)
        //    => controller.ActionSettingsCollection.FirstOrDefault(x => x.ActionMethod
        //        .EndsWith(actionMethodName, StringComparison.OrdinalIgnoreCase));

        public static ControllerEndpointSettings ExpandMembersExplicitly(
            this ControllerEndpointSettings controller,
            params string[] membersToExpand)
        {
            controller.AutoExpandMembers       = false;
            controller.ExplicitExpandedMembers = membersToExpand;
            return(controller);
        }
        public static ControllerEndpointSettings Add(this RapierConfigurationOptions options,
                                                     Type entityType, string route)
        {
            var controller = new ControllerEndpointSettings
            {
                Route = route,
                ActionSettingsCollection = _controllerMethods
            };

            options.EndpointSettingsCollection.Add(entityType, controller);
            return(controller);
        }