1234567891011121314151617181920212223242526272829303132333435 |
-
- using MongoDB.Bson.Serialization.Attributes;
- namespace KYFramework
- {
- [BsonIgnoreExtraElements]
- public abstract class ComponentWithId : Component
- {
- [BsonIgnoreIfDefault]
- [BsonDefaultValue(0L)]
- [BsonElement]
- [BsonId]
- public long Id { get; set; }
- protected ComponentWithId()
- {
- this.Id = this.InstanceId;
- }
- protected ComponentWithId(long id)
- {
- this.Id = id;
- }
- public override void Dispose()
- {
- if (this.IsDisposed)
- {
- return;
- }
- base.Dispose();
- }
- }
- }
|