using SharedLibraryCore.Interfaces; using System; using System.Collections.Concurrent; using System.ComponentModel.DataAnnotations.Schema; namespace SharedLibraryCore.Database.Models { public class SharedEntity : IPropertyExtender { private readonly ConcurrentDictionary _additionalProperties; /// /// indicates if the entity is active /// public bool Active { get; set; } = true; public SharedEntity() { _additionalProperties = new ConcurrentDictionary(); } public T GetAdditionalProperty(string name) { return _additionalProperties.ContainsKey(name) ? (T)_additionalProperties[name] : default; } public void SetAdditionalProperty(string name, object value) { if (_additionalProperties.ContainsKey(name)) { _additionalProperties[name] = value; } else { _additionalProperties.TryAdd(name, value); } } ///// ///// Specifies when the entity was created ///// //[Column(TypeName="datetime")] //public DateTime CreatedDateTime { get; set; } ///// ///// Specifies when the entity was updated ///// //[Column(TypeName = "datetime")] //public DateTime? UpdatedDateTime { get;set; } } }