src/NuGetGallery/Services/PackageFileService.cs
/// <summary>
/// Saves the package readme.md file to storage.
/// </summary>
/// <param name="package">The package associated with the readme.</param>
/// <param name="readMeMd">Markdown content.</param>
Saves the package readme.md file to storage.
Saves the package readme . md file to storage .
public async Task SaveReadMeMdFileAsync(Package package, string readMeMd)
        {
            if (string.IsNullOrWhiteSpace(readMeMd))
            {
                throw new ArgumentNullException(nameof(readMeMd));
            }
            var fileName = FileNameHelper.BuildFileName(package, ReadMeFilePathTemplateActive, ServicesConstants.MarkdownFileExtension);
            using (var readMeMdStream = new MemoryStream(Encoding.UTF8.GetBytes(readMeMd)))
            {
                await _fileStorageService.SaveFileAsync(CoreConstants.Folders.PackageReadMesFolderName, fileName, readMeMdStream, overwrite: true);
            }
        }
public async Task SaveReadMeMdFileAsync ( Package package , string readMeMd ) { if ( string . IsNullOrWhiteSpace ( readMeMd ) ) { throw new ArgumentNullException ( nameof ( readMeMd ) ) ; } var fileName = FileNameHelper . BuildFileName ( package , ReadMeFilePathTemplateActive , ServicesConstants . MarkdownFileExtension ) ; using ( var readMeMdStream = new MemoryStream ( Encoding . UTF8 . GetBytes ( readMeMd ) ) ) { await _fileStorageService . SaveFileAsync ( CoreConstants . Folders . PackageReadMesFolderName , fileName , readMeMdStream , overwrite : true ) ; } }
Saves the package readme.md file to storage.
Saves the package readme . md file to storage .
package
Package
The package associated with the readme.
The package associated with the readme .
readMeMd
string
None