adding in stream methods for partial views.

This commit is contained in:
Claus
2016-09-09 13:31:43 +02:00
parent ba09e945f0
commit 0299de4fdd
2 changed files with 30 additions and 0 deletions

View File

@@ -858,6 +858,22 @@ namespace Umbraco.Core.Services
}
}
public Stream GetPartialViewFileContentStream(string filepath)
{
using (var repository = GetPartialViewRepository(PartialViewType.PartialView, UowProvider.GetUnitOfWork()))
{
return repository.GetFileContentStream(filepath);
}
}
public void SetPartialViewFileContent(string filepath, Stream content)
{
using (var repository = GetPartialViewRepository(PartialViewType.PartialView, UowProvider.GetUnitOfWork()))
{
repository.SetFileContent(filepath, content);
}
}
#endregion
private void Audit(AuditType type, string message, int userId, int objectId)

View File

@@ -293,5 +293,19 @@ namespace Umbraco.Core.Services
/// <param name="filepath">The filesystem path to the macro partial view.</param>
/// <param name="content">The content of the macro partial view.</param>
void SetPartialViewMacroFileContent(string filepath, Stream content);
/// <summary>
/// Gets the content of a partial view as a stream.
/// </summary>
/// <param name="filepath">The filesystem path to the partial view.</param>
/// <returns>The content of the partial view.</returns>
Stream GetPartialViewFileContentStream(string filepath);
/// <summary>
/// Sets the content of a partial view.
/// </summary>
/// <param name="filepath">The filesystem path to the partial view.</param>
/// <param name="content">The content of the partial view.</param>
void SetPartialViewFileContent(string filepath, Stream content);
}
}