Exemple #1
0
        internal static Versioned <T> InsertVersioned <T>(
            this LiteDatabase db, Versioned <T> verDoc)
        {
            var id = db.Version1 <T>().Insert(verDoc);

            verDoc.Id = id;
            return(verDoc);
        }
Exemple #2
0
        public static Versioned <T> Update <T>(this LiteRevisionsDB <T> revDb,
                                               long groupId, T newDTO, string updatedBy, string changeLog)
        {
            var newVer = new Versioned <T>
            {
                GroupId    = groupId,
                Content    = newDTO,
                ChangeLog  = changeLog,
                ChangedBy  = updatedBy,
                ChangeDate = DateTime.Now
            };

            using (var db = revDb.OpenWrite())
                return(db.InsertVersioned(newVer));
        }