| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using MongoDB.Bson.Serialization.Attributes;
- namespace ETModel
- {
- [BsonIgnoreExtraElements]
- public abstract partial class Component: Disposer
- {
- [BsonIgnoreIfDefault]
- [BsonDefaultValue(0L)]
- [BsonElement]
- [BsonId]
- public long Id { get; set; }
- [BsonIgnore]
- public Component Parent { get; set; }
- public T GetParent<T>() where T : Component
- {
- return this.Parent as T;
- }
- [BsonIgnore]
- public Entity Entity
- {
- get
- {
- return this.Parent as Entity;
- }
- }
- public override void Dispose()
- {
- if (this.IsDisposed)
- {
- return;
- }
- base.Dispose();
- }
- }
- }
|