diff --git a/AutoEntityGenerator.CodeGenerator/MappingsClassGenerator.cs b/AutoEntityGenerator.CodeGenerator/MappingsClassGenerator.cs index bec76f3..a9889d9 100644 --- a/AutoEntityGenerator.CodeGenerator/MappingsClassGenerator.cs +++ b/AutoEntityGenerator.CodeGenerator/MappingsClassGenerator.cs @@ -1,4 +1,5 @@ using AutoEntityGenerator.Common.CodeInfo; +using System.Linq; namespace AutoEntityGenerator.CodeGenerator; @@ -13,7 +14,12 @@ public string GenerateMappingClassCode(Entity from, Entity to) { var indentationLevel = from.Namespace.IsFileScoped ? 3 : 4; var indentation = new string('\t', indentationLevel); - var properties = GenerateProperties(from.Properties, p => $"{indentation}{p.Name} = source.{p.Name},"); + var properties = GenerateProperties( + to.Properties.Count < from.Properties.Count + ? to.Properties + : from.Properties, + p => $"{indentation}{p.Name} = source.{p.Name}," + ); return GenerateCode(from, to, properties); } diff --git a/AutoEntityGenerator.Manifest/Overview.md b/AutoEntityGenerator.Manifest/Overview.md index ebc2a26..9a53e62 100644 --- a/AutoEntityGenerator.Manifest/Overview.md +++ b/AutoEntityGenerator.Manifest/Overview.md @@ -23,11 +23,11 @@ For more information, visit the [ReadMe](https://github.com/Peled-Zohar/AutoEnti ## Please consider rating **AutoEntityGenerator** or leaving a review to help improve it! Your feedback is valuable, whether it’s positive or critical, and will help shape future updates. + ## Changes from previous version: -1 Added an option to automatically open newly generated files in the editor. -2 fixed a minor typo in UI -> ("Browes" to "Browse") +1 fixed a bug in mapping extension method generation for response DTOs. ## How to use diff --git a/AutoEntityGenerator.Manifest/Properties/AssemblyInfo.cs b/AutoEntityGenerator.Manifest/Properties/AssemblyInfo.cs index 07265cc..08c82b6 100644 --- a/AutoEntityGenerator.Manifest/Properties/AssemblyInfo.cs +++ b/AutoEntityGenerator.Manifest/Properties/AssemblyInfo.cs @@ -28,5 +28,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.3.1.0")] -[assembly: AssemblyFileVersion("2.3.1.0")] +[assembly: AssemblyVersion("2.3.2.0")] +[assembly: AssemblyFileVersion("2.3.2.0")] diff --git a/AutoEntityGenerator.Manifest/source.extension.vsixmanifest b/AutoEntityGenerator.Manifest/source.extension.vsixmanifest index c4851e4..bc5f844 100644 --- a/AutoEntityGenerator.Manifest/source.extension.vsixmanifest +++ b/AutoEntityGenerator.Manifest/source.extension.vsixmanifest @@ -1,7 +1,7 @@ - + AutoEntityGenerator Automatically generates DTO and mapping classes based on your domain entities. https://github.com/Peled-Zohar/AutoEntityGenerator/blob/main/README.md