/// <summary> /// Gets or adds a controller action convention builder for the specified method. /// </summary> /// <param name="actionMethod">The controller action method to get or add the convention builder for.</param> /// <returns>A new or existing <see cref="ActionApiVersionConventionBuilder">controller action convention builder</see>.</returns> protected internal virtual ActionApiVersionConventionBuilder GetOrAdd(MethodInfo actionMethod) { Arg.NotNull(actionMethod, nameof(actionMethod)); var mapping = actionBuilderMappings.FirstOrDefault(m => m.Method == actionMethod); if (mapping == null) { mapping = new ActionBuilderMapping(actionMethod, new ActionApiVersionConventionBuilder(controllerBuilder)); actionBuilderMappings.Add(mapping); } return(mapping.Builder); }
/// <summary> /// Gets or adds a controller action convention builder for the specified method. /// </summary> /// <param name="actionMethod">The controller action method to get or add the convention builder for.</param> /// <returns>A new or existing <see cref="ODataActionQueryOptionsConventionBuilder{T}">controller action convention builder</see>.</returns> protected internal virtual ODataActionQueryOptionsConventionBuilder <T> GetOrAdd(MethodInfo actionMethod) { Arg.NotNull(actionMethod, nameof(actionMethod)); var mapping = actionBuilderMappings.FirstOrDefault(m => m.Method == actionMethod); if (mapping == null) { mapping = new ActionBuilderMapping <T>(actionMethod, new ODataActionQueryOptionsConventionBuilder <T>(controllerBuilder)); actionBuilderMappings.Add(mapping); } return(mapping.Builder); }