SingleCollectionAttribute 类
表示用于指定实体的单一集合存储属性。此属性用于配合 ISupportedSingleCollection 接口使用, 用于定义实体属于哪个父实体的子集合,以及在数据库中使用的集合名称。
继承成员
命名空间: Fantasy.Entitas.Interface
程序集: Fantasy.Net.dll
语法
[AttributeUsage(AttributeTargets.Class, Inherited = true, AllowMultiple = false)]
public class SingleCollectionAttribute : Attribute
构造函数
| 编辑本文 查看源代码SingleCollectionAttribute(Type, string)
初始化 SingleCollectionAttribute 类的新实例,指定父实体类型和集合名称。
声明
public SingleCollectionAttribute(Type rootType, string collectionName)
参数
类型 | 名称 | 描述 |
---|---|---|
Type | rootType | 父实体的类型。 |
string | collectionName | 在数据库中使用的集合名称。 |
字段
| 编辑本文 查看源代码CollectionName
获取在数据库中使用的集合名称。
声明
public readonly string CollectionName
字段值
类型 | 描述 |
---|---|
string |
RootType
获取父实体的类型,指示此实体是属于哪个父实体的子集合。
声明
public readonly Type RootType
字段值
类型 | 描述 |
---|---|
Type |