Search Results for

    Show / Hide Table of Contents
    View Source

    Class ContentModelBinder

    Maps view models, supporting mapping to and from any IPublishedContent or IContentModel.

    Inheritance
    object
    Namespace: Umbraco.Cms.Web.Common.ModelBinders
    Assembly: Umbraco.Web.Common.dll
    Syntax
    public class ContentModelBinder

    Constructors

    View Source

    ContentModelBinder(IEventAggregator)

    Initializes a new instance of the ContentModelBinder class.

    Declaration
    public ContentModelBinder(IEventAggregator eventAggregator)
    Parameters
    Type Name Description
    IEventAggregator eventAggregator

    Methods

    View Source

    BindModel(ModelBindingContext, object?, Type)

    Attempts to bind the model

    Declaration
    public void BindModel(ModelBindingContext bindingContext, object? source, Type modelType)
    Parameters
    Type Name Description
    ModelBindingContext bindingContext
    object source
    Type modelType
    View Source

    BindModelAsync(ModelBindingContext)

    Attempts to bind a model.

    Declaration
    public Task BindModelAsync(ModelBindingContext bindingContext)
    Parameters
    Type Name Description
    ModelBindingContext bindingContext

    The Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.

    Returns
    Type Description
    Task

    A System.Threading.Tasks.Task which will complete when the model binding process completes.

    If model binding was successful, the Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.Result should have Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.IsModelSet set to true.

    A model binder that completes successfully should set Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext.Result to a value returned from Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingResult.Success(object).

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX