using MongoDB.Bson.Serialization.Attributes; namespace BeautySaloonNoSQLDatabaseImplement { public class ServiceOrder { [BsonElement("service")] public Service Service { get; set; } [BsonElement("employee")] public Employee Employee { get; set; } [BsonElement("time")] private string DateMongo { get; set; } [BsonIgnore] public TimeOnly Date { get { return TimeOnly.Parse(DateMongo); } set { DateMongo = value.ToShortTimeString(); } } } }