diff --git a/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/EasyMicroservices.MapGeneration.ConsoleApp.csproj b/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/EasyMicroservices.MapGeneration.ConsoleApp.csproj index d3d689b..0f1357e 100644 --- a/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/EasyMicroservices.MapGeneration.ConsoleApp.csproj +++ b/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/EasyMicroservices.MapGeneration.ConsoleApp.csproj @@ -1,15 +1,14 @@ - + Exe net7.0 enable - enable + true - diff --git a/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/Program.cs b/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/Program.cs index 0b9246b..934977d 100644 --- a/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/Program.cs +++ b/src/CSharp/EasyMicroservices.MapGeneration.ConsoleApp/Program.cs @@ -15,16 +15,10 @@ static async Task Main(string[] args) { try { - Console.WriteLine("Please set Map.json (enter to generate last file openned)"); - var jsonFilePath = Console.ReadLine(); var pathProvider = new SystemPathProvider(); string lastFileOppened = pathProvider.Combine(AppDomain.CurrentDomain.BaseDirectory, "LastFile.txt"); - if (string.IsNullOrEmpty(jsonFilePath)) - { - if (File.Exists(lastFileOppened)) - jsonFilePath = await File.ReadAllTextAsync(lastFileOppened, Encoding.UTF8); - } - + var jsonFilePath = await LoadFilePath(args, lastFileOppened); + Console.WriteLine($"File opend: {jsonFilePath}"); var appPath = AppDomain.CurrentDomain.BaseDirectory; EnvironmentLoader loader = new EnvironmentLoader(new NewtonsoftJsonProvider(), new DiskFileProvider(new DiskDirectoryProvider(appPath, pathProvider))); await loader.Load(jsonFilePath); @@ -32,7 +26,7 @@ static async Task Main(string[] args) var environmentSchemaBuild = await generation.Build(); CSharpBuilder cSharpBuilder = new CSharpBuilder(); var compiled = await cSharpBuilder.Build(environmentSchemaBuild); - string savedToPath = pathProvider.Combine(loader.AppData.Environments.First().GenerationPath, "CompileTimeClassesMappers.cs"); + string savedToPath = pathProvider.Combine(loader.AppData.Environments.First().GetGenerationPath(), "CompileTimeClassesMappers.cs"); await File.WriteAllTextAsync(savedToPath, compiled.ToString(), Encoding.UTF8); Console.WriteLine($"Generated to {savedToPath}"); await File.WriteAllTextAsync(lastFileOppened, jsonFilePath, Encoding.UTF8); @@ -44,5 +38,25 @@ static async Task Main(string[] args) Console.ReadLine(); await Main(args); } + + /// + /// + /// + /// + /// + /// + static async Task LoadFilePath(string[] args, string lastFileOppened) + { + if (args != null && args.Any() && File.Exists(args[0])) + return args[0]; + Console.WriteLine("Please set Map.json (enter to generate last file openned)"); + var jsonFilePath = Console.ReadLine(); + if (string.IsNullOrEmpty(jsonFilePath)) + { + if (File.Exists(lastFileOppened)) + jsonFilePath = await File.ReadAllTextAsync(lastFileOppened, Encoding.UTF8); + } + return jsonFilePath; + } } } \ No newline at end of file diff --git a/src/CSharp/EasyMicroservices.MapGeneration.Logics/Models/EnvironmentInfo.cs b/src/CSharp/EasyMicroservices.MapGeneration.Logics/Models/EnvironmentInfo.cs index 78f2a8c..3cf7986 100644 --- a/src/CSharp/EasyMicroservices.MapGeneration.Logics/Models/EnvironmentInfo.cs +++ b/src/CSharp/EasyMicroservices.MapGeneration.Logics/Models/EnvironmentInfo.cs @@ -15,7 +15,7 @@ public class EnvironmentInfo public string GetGenerationPath() { - return GenerationPath.Replace(PathConstants.ExecutionPath,AppDomain.CurrentDomain.BaseDirectory); + return GenerationPath.Replace(PathConstants.ExecutionPath, AppDomain.CurrentDomain.BaseDirectory); } public string GetBuildPath() diff --git a/src/CSharp/EasyMicroservices.Mapper.AutoMapper/EasyMicroservices.Mapper.AutoMapper.csproj b/src/CSharp/EasyMicroservices.Mapper.AutoMapper/EasyMicroservices.Mapper.AutoMapper.csproj index cf990c8..4044fd7 100644 --- a/src/CSharp/EasyMicroservices.Mapper.AutoMapper/EasyMicroservices.Mapper.AutoMapper.csproj +++ b/src/CSharp/EasyMicroservices.Mapper.AutoMapper/EasyMicroservices.Mapper.AutoMapper.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 Map objects. EasyMicroservices@gmail.com map,mapper,clone,coppy diff --git a/src/CSharp/EasyMicroservices.Mapper.CompileTimeMapper/EasyMicroservices.Mapper.CompileTimeMapper.csproj b/src/CSharp/EasyMicroservices.Mapper.CompileTimeMapper/EasyMicroservices.Mapper.CompileTimeMapper.csproj index 6daf34b..2fca5b2 100644 --- a/src/CSharp/EasyMicroservices.Mapper.CompileTimeMapper/EasyMicroservices.Mapper.CompileTimeMapper.csproj +++ b/src/CSharp/EasyMicroservices.Mapper.CompileTimeMapper/EasyMicroservices.Mapper.CompileTimeMapper.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.5 + 0.0.0.6 Map objects. EasyMicroservices@gmail.com map,mapper,clone,coppy diff --git a/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/EasyMicroservices.Mapper.SerializerMapper.csproj b/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/EasyMicroservices.Mapper.SerializerMapper.csproj index 19d5d59..86f085f 100644 --- a/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/EasyMicroservices.Mapper.SerializerMapper.csproj +++ b/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/EasyMicroservices.Mapper.SerializerMapper.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.2 + 0.0.0.3 Map objects. EasyMicroservices@gmail.com map,mapper,clone,coppy @@ -16,7 +16,7 @@ - + diff --git a/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/Providers/SerializerMapperProvider.cs b/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/Providers/SerializerMapperProvider.cs index e4fbf33..bb34ef2 100644 --- a/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/Providers/SerializerMapperProvider.cs +++ b/src/CSharp/EasyMicroservices.Mapper.SerializerMapper/Providers/SerializerMapperProvider.cs @@ -9,13 +9,13 @@ namespace EasyMicroservices.Mapper.SerializerMapper.Providers /// public class SerializerMapperProvider : BaseMapperProvider { - private readonly ITextSerialization _textSerialization; - private readonly IBinarySerialization _binarySerialization; + private readonly ITextSerializationProvider _textSerialization; + private readonly IBinarySerializationProvider _binarySerialization; /// /// /// /// - public SerializerMapperProvider(ITextSerialization textSerialization) + public SerializerMapperProvider(ITextSerializationProvider textSerialization) { if (textSerialization == null) throw new ArgumentNullException(nameof(textSerialization)); @@ -26,7 +26,7 @@ public SerializerMapperProvider(ITextSerialization textSerialization) /// /// /// - public SerializerMapperProvider(IBinarySerialization binarySerialization) + public SerializerMapperProvider(IBinarySerializationProvider binarySerialization) { if (binarySerialization == null) throw new ArgumentNullException(nameof(binarySerialization)); diff --git a/src/CSharp/EasyMicroservices.Mapper.Tests/EasyMicroservices.Mapper.Tests.csproj b/src/CSharp/EasyMicroservices.Mapper.Tests/EasyMicroservices.Mapper.Tests.csproj index da0593a..09eb3fc 100644 --- a/src/CSharp/EasyMicroservices.Mapper.Tests/EasyMicroservices.Mapper.Tests.csproj +++ b/src/CSharp/EasyMicroservices.Mapper.Tests/EasyMicroservices.Mapper.Tests.csproj @@ -1,16 +1,18 @@  - netcoreapp3.1;net6.0;net5.0 + netcoreapp3.1;net6.0;net7.0 false latest - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/CSharp/EasyMicroservices.Mapper/EasyMicroservices.Mapper.csproj b/src/CSharp/EasyMicroservices.Mapper/EasyMicroservices.Mapper.csproj index a34d663..e584f66 100644 --- a/src/CSharp/EasyMicroservices.Mapper/EasyMicroservices.Mapper.csproj +++ b/src/CSharp/EasyMicroservices.Mapper/EasyMicroservices.Mapper.csproj @@ -5,7 +5,7 @@ AnyCPU;x64;x86 EasyMicroservices true - 0.0.0.4 + 0.0.0.5 Map objects. EasyMicroservices@gmail.com map,mapper,clone,coppy