.NET tool for automatic generation of DTOs
For annotations.
dotnet add package SpawnDto.CoreFor generating DTOs.
dotnet tool install SpawnDto --create-manifest-if-neededdotnet spawndto -a [assembly] --dto [dto-output-path] -n [dto-namespace] --convertorOutputPath [convertor-path] --convertorNamespace [convertor-namespace]Add this to you .csproj file.
<Target Name="Generate DTOs" AfterTargets="PostBuildEvent">
<Exec Command="dotnet spawndto -a $(OutDir)$(TargetName).dll --dto [dto-output-path] -n [dto-namespace] --convertorOutputPath [convertor-path] --convertorNamespace [convertor-namespace]" ContinueOnError="false" />
</Target>This will generate DTOs every time after the project is build.
TODO: Implement the logic for generating convertors that can be used by DI.