Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssetFileCollection"/> class.
 /// </summary>
 /// <param name="cloudMediaContext">The cloud media context.</param>
 /// <param name="parentAsset">The parent <see cref="IAsset"/>.</param>
 internal AssetFileCollection(MediaContextBase cloudMediaContext, IAsset parentAsset)
     : this(cloudMediaContext)
 {
     _parentAsset = parentAsset;
     MediaServicesClassFactory factory = this.MediaContext.MediaServicesClassFactory;
     this._assetFileQuery = new Lazy <IQueryable <IAssetFile> >(() => factory.CreateDataServiceContext().CreateQuery <IAssetFile, AssetFileData>(FileSet));
 }
Пример #2
0
        public static IMediaDataServiceContext CreateCustomDataServiceContext(this MediaServicesClassFactory factory)
        {
            var azureFactory          = (AzureMediaServicesClassFactory)factory;
            var serviceVersionAdapter = new ServiceVersionAdapter(CurrentVersion);

            typeof(AzureMediaServicesClassFactory)
            .GetField("_serviceVersionAdapter", BindingFlags.Instance | BindingFlags.NonPublic)
            .SetValue(azureFactory, serviceVersionAdapter);

            return(azureFactory.CreateDataServiceContext());
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="IngestManifestFileCollection"/> class.
        /// </summary>
        /// <param name="mediaContext"></param>
        /// <param name="parentIngestManifestAsset">The parent manifest asset.</param>
        internal IngestManifestFileCollection(MediaContextBase mediaContext, IIngestManifestAsset parentIngestManifestAsset)
            : base(mediaContext)
        {
            MediaServicesClassFactory factory = this.MediaContext.MediaServicesClassFactory;

            this._query = new Lazy <IQueryable <IIngestManifestFile> >(() => factory.CreateDataServiceContext().CreateQuery <IIngestManifestFile, IngestManifestFileData>(EntitySet));

            if (parentIngestManifestAsset != null)
            {
                this._parentIngestManifestAsset = (IngestManifestAssetData)parentIngestManifestAsset;
            }
        }