using System; using MongoDB.Bson.Serialization.Attributes; namespace Common.Base { /// /// Component的Id与Owner Entity Id一样 /// public abstract class Component: Object where T : Entity { private T owner; [BsonIgnore] public T Owner { get { return this.owner; } set { this.owner = value; this.Id = this.owner.Id; } } /// /// 用于父类的Component需要重写此方法 /// /// public virtual Type GetComponentType() { return this.GetType(); } } }