Search Results for

    Show / Hide Table of Contents
    View Source

    Class UmbracoApiBehaviorApplicationModelProvider

    An application model provider for Umbraco API controllers to behave like WebApi controllers

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Web.Common.ApplicationModels
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public class UmbracoApiBehaviorApplicationModelProvider : IApplicationModelProvider
    Remarks

    Conventions will be applied to controllers attributed with UmbracoApiControllerAttribute

    This is nearly a copy of aspnetcore's ApiBehaviorApplicationModelProvider which supplies a convention for the [ApiController] attribute, however that convention is too strict for our purposes so we will have our own. Uses UmbracoJsonModelBinder for complex parameters and those with BindingSource of Body, but leaves the rest alone see GH #11554

    See https://shazwazza.com/post/custom-body-model-binding-per-controller-in-asp-net-core/ and https://github.com/dotnet/aspnetcore/issues/21724

    Constructors

    View Source

    UmbracoApiBehaviorApplicationModelProvider(IModelMetadataProvider)

    Initializes a new instance of the UmbracoApiBehaviorApplicationModelProvider class.

    Declaration
    public UmbracoApiBehaviorApplicationModelProvider(IModelMetadataProvider modelMetadataProvider)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider modelMetadataProvider

    Properties

    View Source

    Order

    Will execute after Microsoft.AspNetCore.Mvc.ApplicationModels.DefaultApplicationModelProvider

    Declaration
    public int Order { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    View Source

    OnProvidersExecuted(ApplicationModelProviderContext)

    Declaration
    public void OnProvidersExecuted(ApplicationModelProviderContext context)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelProviderContext context
    View Source

    OnProvidersExecuting(ApplicationModelProviderContext)

    Declaration
    public void OnProvidersExecuting(ApplicationModelProviderContext context)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelProviderContext context
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • UmbracoApiBehaviorApplicationModelProvider(IModelMetadataProvider)
    • Properties
      • Order
    • Methods
      • OnProvidersExecuted(ApplicationModelProviderContext)
      • OnProvidersExecuting(ApplicationModelProviderContext)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX