diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index 343e176..e9b29e7 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -34,11 +34,13 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
+ - run: dotnet build --configuration Release
+
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack --configuration Release --output ${{ env.NuGetDirectory }}
# Publish the NuGet package as an artifact, so they can be used in the following jobs
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
name: nuget
if-no-files-found: error
@@ -54,7 +56,7 @@ jobs:
uses: actions/setup-dotnet@v4
# Download the NuGet package created in the previous job
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
@@ -67,7 +69,7 @@ jobs:
# If some rules are not applicable, you can disable them
# using the --excluded-rules or --excluded-rule-ids option
- name: Validate package
- run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg")
+ run: meziantou.validate-nuget-package (Get-ChildItem "${{ env.NuGetDirectory }}/*.nupkg") --excluded-rules Symbols,IconMustBeSet,LicenseMustBeSet
run_test:
runs-on: ubuntu-latest
@@ -87,7 +89,7 @@ jobs:
needs: [ validate_nuget, run_test ]
steps:
# Download the NuGet package created in the previous job
- - uses: actions/download-artifact@v3
+ - uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
diff --git a/DtoGenerator/DtoGenerator.csproj b/DtoGenerator/DtoGenerator.csproj
index 00e74ef..cb8c137 100644
--- a/DtoGenerator/DtoGenerator.csproj
+++ b/DtoGenerator/DtoGenerator.csproj
@@ -15,7 +15,13 @@
readme.md
true
https://github.com/Ten-James/DtoGenerator/blob/master/LICENSE.md
- james-dto-generator-library
+ TenJames.DtoGenerator
+ MIT
+ Generator DTO WebApi
+
+
+
+ bin\Release\DtoGenerator.xml
diff --git a/README.md b/README.md
index cdace5c..e068d12 100644
--- a/README.md
+++ b/README.md
@@ -2,3 +2,66 @@
Stop writing boilerplate code for your DTOs. This package will generate them for you.
+# Introduction
+
+Since its generator library, and it works on compile time you have to set the output type, for the dependency,
+
+```xml
+
+```
+
+# Example
+
+```csharp
+
+[GenerateDto(DtoType.All)]
+class User
+{
+ [MapTo(typeof(string), "src.ToString()")]
+ [DtoVisibility(DtoType.AllRead | DtoType.Update)]
+ public Guid Id { get; set; }
+
+ public string Name { get; set; }
+
+ [DtoIgnore]
+ public string Password { get; set; }
+
+}
+
+
+// will generate the following DTOs
+
+class UserReadDto
+{
+ [Required] public string Id { get; set; }
+ [Required] public string Name { get; set; }
+}
+
+class UserReadDetailDto
+{
+ [Required] public string Id { get; set; }
+ [Required] public string Name { get; set; }
+}
+
+class UserCreateDto
+{
+ [Required] public string Name { get; set; }
+}
+
+class UserUpdateDto
+{
+ [Required] public string Name { get; set; }
+}
+
+
+
+```
+
+# Attributes
+
+Main usage ate defined with attrubutes. The following attributes are available:
+
+- `GenerateDtoAttribute`: Entry point for the generator. It will generate a DTO for the class where it is defined.
+- `DtoIgnoreAttribute`: Ignore a property from the DTO generation.
+- `MapToAttribute`: Mapping a property with function to the DTO (read and detail)
+- `MapFromAttribute`: Mapping a property with function from the DTO (write)