/// <summary> /// Opens a text file, writes all the text in the file into a string asynchronously, and then closes the opened stream. /// The default encoding is UTF8. /// /// If the file already exists, it is overwritten. /// </summary> /// <param name="this">The <see cref="IFile"/> to read.</param> /// <param name="contents">The contents to write to file.</param> /// <returns>A string containing all text in the file.</returns> public static Task WriteAllTextAsync(this IFile @this, string contents) => FileExtensions.WriteAllTextAsync(@this, contents, Encoding.UTF8);