Split LeafOutputFile content into different table for performance
This commit is contained in:
@@ -63,7 +63,7 @@ namespace LeafWeb.Core.Entities
|
||||
foreach (var outputFile in OutputFiles.Where(f => !fileType.HasValue || f.FileType==fileType.Value))
|
||||
{
|
||||
var entry = archive.CreateEntry(outputFile.Filename);
|
||||
using (var originalFileStream = new MemoryStream(outputFile.Contents))
|
||||
using (var originalFileStream = new MemoryStream(outputFile.FileContents.Contents))
|
||||
using (var entryStream = entry.Open())
|
||||
originalFileStream.CopyTo(entryStream);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ namespace LeafWeb.Core.Entities
|
||||
|
||||
public int GetOutputFileSizeSum()
|
||||
{
|
||||
return OutputFiles.Sum(o => o.Contents.Length);
|
||||
return OutputFiles.Sum(o => o.FileContents.Contents.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,7 @@ namespace LeafWeb.Core.Entities
|
||||
public int Id { get; set; }
|
||||
|
||||
public virtual LeafInput LeafInput { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Parsed values from the LeafInput used in LeafWeb for filtering/searching
|
||||
/// </summary>
|
||||
// public virtual LeafInputInfo LeafInputInfo { get; set; }
|
||||
|
||||
|
||||
public string Filename { get; set; }
|
||||
|
||||
public byte[] Contents { get; set; }
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace LeafWeb.Core.Entities
|
||||
|
||||
public string Filename { get; set; }
|
||||
|
||||
public byte[] Contents { get; set; }
|
||||
public virtual LeafOutputFileContents FileContents { get; set; }
|
||||
|
||||
public bool IsLeafChartFile => Filename?.Contains(Filename_LeafChart) ?? false;
|
||||
public bool IsErrorMessage => Filename?.Contains(Filename_ErrorMessage) ?? false;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace LeafWeb.Core.Entities
|
||||
{
|
||||
public class LeafOutputFileContents
|
||||
{
|
||||
[ForeignKey("LeafOutputFile")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public virtual LeafOutputFile LeafOutputFile { get; set; }
|
||||
|
||||
public byte[] Contents { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user