Exemplo n.º 1
0
        /// <summary>
        /// Gets the file for the specified identifier.
        /// </summary>
        /// <param name="id">The file identifier.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken" /> used to propagate notifications that the operation should be canceled.</param>
        /// <returns>
        /// The file object.
        /// </returns>
        public async Task <File?> FindByIdAsync(long id, CancellationToken cancellationToken)
        {
            var file = await FileStore.FindByIdAsync(id, cancellationToken);

            file?.SetBinaryProvider(SupportedBinaryProviders.ContainsKey(file.ProviderType) ? SupportedBinaryProviders[file.ProviderType] : null);
            return(file);
        }