Show / Hide Table of Contents

Class ClassMapper<T>

默认泛型实体映射器类

Inheritance
System.Object
ClassMapper<T>
AutoClassMapper<T>
AutoEntityMapper<T>
Namespace: DapperDal.Mapper
Assembly: DapperDal.dll
Syntax
public class ClassMapper<T> : object, IClassMapper<T>, IClassMapper where T : class
Type Parameters
Name Description
T

Constructors

| Improve this Doc View Source

ClassMapper()

初始化默认泛型实体映射器

Declaration
public ClassMapper()

Properties

| Improve this Doc View Source

EntityType

实体类型

Declaration
public Type EntityType { get; }
Property Value
Type Description
Type
Implements
IClassMapper.EntityType
| Improve this Doc View Source

Properties

实体属性信息列表

Declaration
public IList<IPropertyMap> Properties { get; }
Property Value
Type Description
IList<IPropertyMap>
Implements
IClassMapper.Properties
| Improve this Doc View Source

PropertyTypeKeyTypeMapping

属性类型与键类型的对应关系字典

Declaration
protected Dictionary<Type, KeyType> PropertyTypeKeyTypeMapping { get; }
Property Value
Type Description
Dictionary<Type, KeyType>
| Improve this Doc View Source

SchemaName

数据库架构名

Declaration
public string SchemaName { get; protected set; }
Property Value
Type Description
System.String
Implements
IClassMapper.SchemaName
| Improve this Doc View Source

TableName

数据库表名

Declaration
public string TableName { get; protected set; }
Property Value
Type Description
System.String
Implements
IClassMapper.TableName

Methods

| Improve this Doc View Source

AutoMap()

执行自动映射

Declaration
protected virtual void AutoMap()
| Improve this Doc View Source

AutoMap(Func<Type, PropertyInfo, Boolean>)

执行自动映射

Declaration
protected virtual void AutoMap(Func<Type, PropertyInfo, bool> canMap)
Parameters
Type Name Description
Func<Type, PropertyInfo, System.Boolean> canMap

指示实体属性是否要映射的方法提供

| Improve this Doc View Source

Map(Expression<Func<T, Object>>)

设置实体属性映射,支持链式调用

Declaration
protected PropertyMap Map(Expression<Func<T, object>> expression)
Parameters
Type Name Description
Expression<Func<T, System.Object>> expression

实体属性映射表达式

Returns
Type Description
PropertyMap

实体属性映射器

| Improve this Doc View Source

Map(PropertyInfo)

设置实体属性映射,支持链式调用

Declaration
protected PropertyMap Map(PropertyInfo propertyInfo)
Parameters
Type Name Description
PropertyInfo propertyInfo

实体属性元数据访问器

Returns
Type Description
PropertyMap

实体属性映射器

| Improve this Doc View Source

Schema(String)

设置数据库架构名

Declaration
public virtual void Schema(string schemaName)
Parameters
Type Name Description
System.String schemaName

数据库架构名

| Improve this Doc View Source

Table(String)

设置数据库表名

Declaration
public virtual void Table(string tableName)
Parameters
Type Name Description
System.String tableName

设置数据库表名

Extension Methods

SortingExtensions.ToSortable(Object)
  • Improve this Doc
  • View Source
Back to top Copyright © 2015-2017 Microsoft
Generated by DocFX