Example #1
0
        public void Apply(Document entity, Patcher patcher)
        {
            entity.Id          = Id;
            entity.Title       = Title;
            entity.Description = Description;
            entity.UserId      = UserId;

            if (entity.IsNew())
            {
                entity.Archive    = patcher.NewInstance(Archive);
                entity.CreateDate = DateTime.Now;
            }
            else
            {
                patcher.AttachAndApply(Archive, entity.ArchiveId);
            }
        }