---
title: "クラスバインディングビューコンポーネント"
slug: "sitecore.aspnet.renderingengine.mvc.bindingviewcomponent"
abstract: ""
---
# クラスバインディングビューコンポーネント

Microsoftの遅延バインディングを提供します。AspNetCore.Mvc.ViewComponent。

## 相続

System.Object

BindingViewComponent

[SitecoreComponentViewComponent](https://doc.sitecore.com/xp/ja/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.viewcomponents.sitecorecomponentviewcomponent.html)

### **名前空間**:Sitecore。AspNet.RenderingEngine.Mvc

#### **アセンブリ**:Sitecore。AspNet.RenderingEngine.dll

##### 構文論

public abstract class BindingViewComponent : ViewComponent

### コンストラクター

#### BindingViewComponent(IViewModelBinder)

[BindingViewComponent](https://doc.sitecore.com/xp/ja/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.mvc.bindingviewcomponent.html)クラスの新しいインスタンスを初期化します。

##### 宣言

protected BindingViewComponent(IViewModelBinder binder)

##### パラメータ

種類

名称

概要

IViewModelBinder

バインダー

バインディングを可能にするために [IViewModelBinder](https://doc.sitecore.com/xp/ja/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.iviewmodelbinder.html) を使います。

### 性質

#### バインダー

バインディングに使われる[IViewModelBinder](https://doc.sitecore.com/xp/ja/developers/hd/21/sitecore-asp-dot-net-rendering-sdk/sitecore.aspnet.renderingengine.binding.iviewmodelbinder.html)のインスタンスを入手します。

##### 宣言

protected IViewModelBinder Binder { get; }

##### 不動産価値

種類

概要

IViewModelBinder

### 方法

#### BindView(タイプ、文字列)

指定されたビューを割り当てたモデルタイプに割り当てて返します。

##### 宣言

public virtual Task<IViewComponentResult> BindView(Type modelType, string viewName)

##### パラメータ

種類

名称

概要

System.Type

モデルタイプ

バインディングに使うモデルタイプ。

System.String

ビューネーム

その景色は返されるべきだ。

##### 返還

種類

概要

System.Threading.Tasks.Task  
  
<  
  
Microsoft.AspNetCore.Mvc.IViewComponentResult  
  
\>

Microsoft。AspNetCore.Mvc.IViewComponentResult。

#### BindView()

TModelのバウンディングモデルを用いてデフォルトのビューを返します。

##### 宣言

public virtual Task<IViewComponentResult> BindView<TModel>()
 where TModel : class, new()

##### 返還

種類

概要

System.Threading.Tasks.Task  
  
<  
  
Microsoft.AspNetCore.Mvc.IViewComponentResult  
  
\>

Microsoft。AspNetCore.Mvc.IViewComponentResult。

##### 型パラメータ

名称

概要

Tモーデル

バインドされるモデル。

#### BindView(TModel)

与えられたモデルに割り当てられたデフォルトのビューを返します。

##### 宣言

public virtual Task<IViewComponentResult> BindView<TModel>(TModel model)
 where TModel : class

##### パラメータ

種類

名称

概要

Tモーデル

モデル

縛られるべき TModel のインスタンス。

##### 返還

種類

概要

System.Threading.Tasks.Task  
  
<  
  
Microsoft.AspNetCore.Mvc.IViewComponentResult  
  
\>

Microsoft。AspNetCore.Mvc.IViewComponentResult。

##### 型パラメータ

名称

概要

Tモーデル

バインドされるモデル。

#### BindView(文字列)

TModelのバウンドモデルを用いて指定されたビューを返します。

##### 宣言

public virtual Task<IViewComponentResult> BindView<TModel>(string viewName)
 where TModel : class, new()

##### パラメータ

種類

名称

概要

System.String

ビューネーム

その景色は返されるべきだ。

##### 返還

種類

概要

System.Threading.Tasks.Task  
  
<  
  
Microsoft.AspNetCore.Mvc.IViewComponentResult  
  
\>

Microsoft。AspNetCore.Mvc.IViewComponentResult。

##### 型パラメータ

名称

概要

Tモーデル

バインドされるモデル。

#### BindView(String, TModel)

指定されたビューを割り当てたモデルを返します。

##### 宣言

public virtual Task<IViewComponentResult> BindView<TModel>(string viewName, TModel model)
 where TModel : class

##### パラメータ

種類

名称

概要

System.String

ビューネーム

その景色は返されるべきだ。

Tモーデル

モデル

縛られるべき TModel のインスタンス。

##### 返還

種類

概要

System.Threading.Tasks.Task  
  
<  
  
Microsoft.AspNetCore.Mvc.IViewComponentResult  
  
\>

Microsoft。AspNetCore.Mvc.IViewComponentResult。

##### 型パラメータ

名称

概要

Tモーデル

バインドされるモデル。