ChildOfAttribute.cs 477 B

1234567891011121314151617181920
  1. using System;
  2. namespace ET
  3. {
  4. /// <summary>
  5. /// 子实体的父级实体类型约束
  6. /// 父级实体类型唯一的 标记指定父级实体类型[ChildOf(typeof(parentType)]
  7. /// 不唯一则标记[ChildOf]
  8. /// </summary>
  9. [AttributeUsage(AttributeTargets.Class)]
  10. public class ChildOfAttribute : Attribute
  11. {
  12. public Type type;
  13. public ChildOfAttribute(Type type = null)
  14. {
  15. this.type = type;
  16. }
  17. }
  18. }