Example #1
0
        private string ValidateEditDate()
        {
            if (EditDate.ToString("dd-MM-yyyy") == "01-01-0001")
            {
                return("Дата редактирования не указана");
            }

            return(null);
        }
        public BsonDocument ToBsonDocument()
        {
            BsonArray lib = new BsonArray(Library);

            BsonDocument document = new BsonDocument()
            {
                { "_id", _id },
                { "Name", Name },
                { "Library", lib },
                { "ClassName", ClassName },
                { "Duration", Duration },
                { "Delta", Delta },
                { "Interpolation", Interpolation },
                { "Tags", Tags },
                { "Notes", Notes },
                { "CodeSample", CodeSample },
                { "CreationDate", CreationDate.ToString("o") },
                { "EditDate", EditDate.ToString("o") },
                { "Author", Author },
                { "Editor", Editor }
            };

            return(document);
        }