Tasks 184281, 184799, 184800, 184801 and 184802
Align .editorconfig files Move Controller logic to DMO classes GlobalVars.AppSettings = Models.AppSettings.GetFromConfigurationManager(); Question EditorConfig Project level editorconfig Format White Spaces AppSetting when EnvironmentVariable not set Corrective Actions Tests Schedule Actions Tests DMO Tests Controller Tests Get ready to use VSCode IDE
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
#if !NET8
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="BinaryContentResult.cs" company="SemanticArchitecture">
|
||||
// http://www.SemanticArchitecture.net pkalkie@gmail.com
|
||||
// </copyright>
|
||||
@ -7,8 +9,7 @@
|
||||
// </summary>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Fab2ApprovalSystem.PdfGenerator
|
||||
{
|
||||
namespace Fab2ApprovalSystem.PdfGenerator {
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
@ -16,29 +17,27 @@ namespace Fab2ApprovalSystem.PdfGenerator
|
||||
/// <summary>
|
||||
/// An ActionResult used to send binary data to the browser.
|
||||
/// </summary>
|
||||
public class BinaryContentResult : ActionResult
|
||||
{
|
||||
public class BinaryContentResult : ActionResult {
|
||||
private readonly string contentType;
|
||||
private readonly byte[] contentBytes;
|
||||
|
||||
public BinaryContentResult(byte[] contentBytes, string contentType)
|
||||
{
|
||||
public BinaryContentResult(byte[] contentBytes, string contentType) {
|
||||
this.contentBytes = contentBytes;
|
||||
this.contentType = contentType;
|
||||
}
|
||||
|
||||
public override void ExecuteResult(ControllerContext context)
|
||||
{
|
||||
public override void ExecuteResult(ControllerContext context) {
|
||||
var response = context.HttpContext.Response;
|
||||
response.Clear();
|
||||
response.Cache.SetCacheability(HttpCacheability.Public);
|
||||
response.ContentType = this.contentType;
|
||||
|
||||
using (var stream = new MemoryStream(this.contentBytes))
|
||||
{
|
||||
using (var stream = new MemoryStream(this.contentBytes)) {
|
||||
stream.WriteTo(response.OutputStream);
|
||||
stream.Flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user