Beispiel #1
0
        public IMediaProcessor GetLatestMediaProcessorByName(MediaProcessorName mediaProcessorName) {
            Logger.Debug("GetLatestMediaProcessorByName() invoked for media processor '{0}'.", mediaProcessorName);

            var processorQuery =
                from p in Context.MediaProcessors
                where p.Name == mediaProcessorName.Name
                select p;

            var latestProcessor =
                (from p in processorQuery.ToArray()
                 orderby new Version(p.Version)
                 select p).LastOrDefault();

            if (latestProcessor == null)
                throw new ArgumentException(String.Format("Unknown media processor '{0}'.", mediaProcessorName));

            return latestProcessor;
        }
        public IMediaProcessor GetLatestMediaProcessorByName(MediaProcessorName mediaProcessorName)
        {
            Logger.Debug("GetLatestMediaProcessorByName() invoked for media processor '{0}'.", mediaProcessorName);

            var processorQuery =
                from p in Context.MediaProcessors
                where p.Name == mediaProcessorName.Name
                select p;

            var latestProcessor =
                (from p in processorQuery.ToArray()
                 orderby new Version(p.Version)
                 select p).LastOrDefault();

            if (latestProcessor == null)
            {
                throw new ArgumentException(String.Format("Unknown media processor '{0}'.", mediaProcessorName));
            }

            return(latestProcessor);
        }