-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from skbkontur/parseMultipleWorksheetsIntoOneM…
…odel parse multiple worksheets into one model object
- Loading branch information
Showing
7 changed files
with
283 additions
and
208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+14 KB
Excel.TemplateEngine.Tests/ObjectPrintingTests/Files/withMultipleWorksheets_target.xlsx
Binary file not shown.
Binary file added
BIN
+12.3 KB
Excel.TemplateEngine.Tests/ObjectPrintingTests/Files/withMultipleWorksheets_template.xlsx
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using SkbKontur.Excel.TemplateEngine.ObjectPrinting.LazyParse; | ||
using SkbKontur.Excel.TemplateEngine.ObjectPrinting.NavigationPrimitives.Implementations; | ||
using SkbKontur.Excel.TemplateEngine.ObjectPrinting.TableBuilder; | ||
using SkbKontur.Excel.TemplateEngine.ObjectPrinting.TableParser; | ||
|
||
namespace SkbKontur.Excel.TemplateEngine | ||
#nullable enable | ||
namespace SkbKontur.Excel.TemplateEngine; | ||
|
||
public interface ITemplateEngine | ||
{ | ||
public interface ITemplateEngine | ||
{ | ||
void Render<TModel>([NotNull] ITableBuilder tableBuilder, [NotNull] TModel model); | ||
void Render<TModel>(ITableBuilder tableBuilder, TModel model) where TModel : notnull; | ||
|
||
(TModel model, Dictionary<string, string> mappingForErrors) Parse<TModel>(ITableParser tableParser) | ||
where TModel : new(); | ||
|
||
(TModel model, Dictionary<string, string> mappingForErrors) Parse<TModel>([NotNull] ITableParser tableParser) | ||
where TModel : new(); | ||
void Parse<TModel>(ITableParser tableParser, Action<string, string> mappingForErrors, ref TModel model) | ||
where TModel : new(); | ||
|
||
public TModel LazyParse<TModel>([NotNull] LazyTableReader lazyTableReader, ObjectSize readerOffset = null, IFormulaEvaluator formulaEvaluator = null) | ||
where TModel : new(); | ||
} | ||
public TModel LazyParse<TModel>(LazyTableReader lazyTableReader, ObjectSize? readerOffset = null, IFormulaEvaluator? formulaEvaluator = null) | ||
where TModel : new(); | ||
} |
19 changes: 10 additions & 9 deletions
19
Excel.TemplateEngine/ObjectPrinting/ParseCollection/Parsers/IClassParser.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
using System; | ||
|
||
using JetBrains.Annotations; | ||
|
||
using SkbKontur.Excel.TemplateEngine.ObjectPrinting.RenderingTemplates; | ||
using SkbKontur.Excel.TemplateEngine.ObjectPrinting.TableParser; | ||
|
||
namespace SkbKontur.Excel.TemplateEngine.ObjectPrinting.ParseCollection.Parsers | ||
#nullable enable | ||
|
||
namespace SkbKontur.Excel.TemplateEngine.ObjectPrinting.ParseCollection.Parsers; | ||
|
||
internal interface IClassParser | ||
{ | ||
internal interface IClassParser | ||
{ | ||
[NotNull] | ||
TModel Parse<TModel>([NotNull] ITableParser tableParser, [NotNull] RenderingTemplate template, [NotNull] Action<string, string> addFieldMapping) | ||
where TModel : new(); | ||
} | ||
TModel Parse<TModel>(ITableParser tableParser, RenderingTemplate template, Action<string, string> addFieldMapping) | ||
where TModel : new(); | ||
|
||
void Parse<TModel>(ITableParser tableParser, RenderingTemplate template, Action<string, string> addFieldMapping, ref TModel model) | ||
where TModel : new(); | ||
} |
Oops, something went wrong.