/// <summary> /// Appends <paramref name="fileContent"/> to the file content. /// </summary> /// <param name="fileContent">Content to append to the file.</param> public static void AppendContentFromByteArray(this IFileContentAppender file, byte[] fileContent) { Task task = file.AppendContentFromByteArrayAsync(fileContent); if (!task.IsCompleted && !task.IsCanceled) { task.RunSynchronously(); } }
/// <summary> /// Appends <paramref name="fileContent"/> to the file content. /// </summary> /// <param name="fileContent">Content to append to the file.</param> public static void AppendContentFromStream(this IFileContentAppender file, Stream fileContent) { Task task = file.AppendContentFromStreamAsync(fileContent); if (!task.IsCompleted && !task.IsCanceled) { task.RunSynchronously(); } }
public static bool TryWithFileContentAppender(this IFile model, out IFileContentAppender feature) { Ensure.NotNull(model, "model"); return(model.TryWith <IFileContentAppender>(out feature)); }