Split LeafOutputFile content into different table for performance

This commit is contained in:
2016-05-23 15:23:36 -04:00
parent 790e2494e3
commit 55f7b68bf8
21 changed files with 307 additions and 19 deletions
+2 -2
View File
@@ -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);
}
}
}
+1 -6
View File
@@ -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; }
+1 -1
View File
@@ -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;
+14
View File
@@ -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; }
}
}