Exemple #1
0
        public void UpdateMedia(MediaMeta media)
        {
            Medium meta = UnitOfWork.MediaRepository.Find(media.Id);

            media.MapInto(meta);
            UnitOfWork.Commit();
        }
Exemple #2
0
        public Guid CreateNewMedia(MediaMeta media)
        {
            if (media == null)
            {
                throw new ArgumentNullException("media");
            }

            using (
                var scope = new TransactionScope(TransactionScopeOption.Required,
                                                 new TransactionOptions {
                IsolationLevel = IsolationLevel.ReadCommitted, Timeout = TransactionManager.MaximumTimeout
            }))
            {
                // Generate metadata.
                var meta = new Medium(media.Id);
                media.MapInto(meta);
                UnitOfWork.MediaRepository.Add(meta);
                UnitOfWork.Commit();

                scope.Complete();
                return(meta.Id);
            }
        }