Component.cs 535 B

1234567891011121314151617181920212223242526
  1. using MongoDB.Bson.Serialization.Attributes;
  2. namespace Common.Base
  3. {
  4. /// <summary>
  5. /// Component的Id与Owner Entity Id一样
  6. /// </summary>
  7. public abstract class Component : Object
  8. {
  9. private Entity owner;
  10. [BsonIgnore]
  11. public Entity Owner
  12. {
  13. get
  14. {
  15. return owner;
  16. }
  17. set
  18. {
  19. this.owner = value;
  20. this.Id = this.owner.Id;
  21. }
  22. }
  23. }
  24. }