Show / Hide Table of Contents

Method RegisterChildModel

| Improve this Doc View Source

RegisterChildModel<TModel, TChildModel>(Expression<Func<TModel, TChildModel>>, Func<TChildModel, T>)

Registers a child model.

Declaration
protected static Mounter<TChildModel> RegisterChildModel<TModel, TChildModel>(Expression<Func<TModel, TChildModel>> getter, Func<TChildModel, T> relationshipGetter)

    where TModel : Model<T> where TChildModel : Model, new()
Parameters
Type Name Description
System.Linq.Expressions.Expression<System.Func<TModel, TChildModel>> getter

The lambda expression of the child model getter.

System.Func<TChildModel, T> relationshipGetter

Gets relationship between child model and parent model.

Returns
Type Description
Mounter<TChildModel>

Mounter of the child model.

Type Parameters
Name Description
TModel

The type of model which the child model is registered on.

TChildModel

The type of the child model.

Exceptions
Type Condition
System.ArgumentNullException

getter is null.

System.ArgumentException

getter expression is not a valid getter.

System.ArgumentNullException

relationshipGetter is null.

  • Improve this Doc
  • View Source
Back to top Copyright © Weifen Luo | DevZest