@@ -7,26 +7,14 @@ namespace Simplify.Web.Postman.IO;
77/// <summary>
88/// Provides model to file exporter
99/// </summary>
10- public class ModelToFileExporter
10+ /// <remarks>
11+ /// Initializes a new instance of the <see cref="ModelToFileExporter" /> class.
12+ /// </remarks>
13+ /// <param name="serializer">The serializer.</param>
14+ /// <param name="environment">The environment.</param>
15+ /// <param name="generationFolderPath">The generation folder path.</param>
16+ public class ModelToFileExporter ( JsonSerializer serializer , IEnvironment environment , string generationFolderPath )
1117{
12- private readonly string _generationFolderPath ;
13-
14- private readonly JsonSerializer _serializer ;
15- private readonly IEnvironment _environment ;
16-
17- /// <summary>
18- /// Initializes a new instance of the <see cref="ModelToFileExporter" /> class.
19- /// </summary>
20- /// <param name="serializer">The serializer.</param>
21- /// <param name="environment">The environment.</param>
22- /// <param name="generationFolderPath">The generation folder path.</param>
23- public ModelToFileExporter ( JsonSerializer serializer , IEnvironment environment , string generationFolderPath )
24- {
25- _generationFolderPath = generationFolderPath ;
26- _serializer = serializer ;
27- _environment = environment ;
28- }
29-
3018 /// <summary>
3119 /// Exports the specified model.
3220 /// </summary>
@@ -39,10 +27,10 @@ public void Export(object model, string fileName)
3927 if ( ! Directory . Exists ( folderPath ) )
4028 Directory . CreateDirectory ( folderPath ) ;
4129
42- File . WriteAllText ( GenerateCollectionFilePath ( folderPath , fileName ) , _serializer . Serialize ( model ) ) ;
30+ File . WriteAllText ( GenerateCollectionFilePath ( folderPath , fileName ) , serializer . Serialize ( model ) ) ;
4331 }
4432
4533 private static string GenerateCollectionFilePath ( string folderPath , string fileName ) => Path . Combine ( folderPath , fileName ) ;
4634
47- private string GenerateExportFolderPath ( ) => Path . Combine ( _environment . AppPhysicalPath , _generationFolderPath ) ;
35+ private string GenerateExportFolderPath ( ) => Path . Combine ( environment . AppPhysicalPath , generationFolderPath ) ;
4836}
0 commit comments