Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/topics/dto-shapes-and-read-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,9 @@ This keeps generated read models compact while still making important related va
Generators no longer have to assume that every relevant type lives in the same project as the active startup target.

When your solution is split across multiple projects, Coalesce can merge discovered types across those project boundaries so generated DTOs and read shapes still resolve the right sources.

## Generated contract shapes let you declare DTO outputs from the source type

Generated contract shapes give you a way to describe class or interface outputs directly from the source model without hand-writing every generated contract by hand.

That makes it practical to define response-shape contracts, transport-specific interfaces, and other generated DTO surfaces while keeping the source of truth close to the domain type.
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ public override IEnumerable<IGenerator> GetGenerators()
.AppendOutputPath($"Generated/{model.ClientTypeName}Dto.g.cs");

}

yield return Generator<GeneratedContracts>()
.WithModel(Model);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
<Description>Generates ASP.NET Core API controllers, DTOs, and Semantic Kernel plugins for Coalesce projects. Learn more at https://coalesce.intellitect.com/</Description>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<ProjectReference
Include="..\IntelliTect.Coalesce.CodeGeneration\IntelliTect.Coalesce.CodeGeneration.csproj" />
<ProjectReference
Include="..\IntelliTect.Coalesce\IntelliTect.Coalesce.csproj" />
</ItemGroup>
</Project>
</Project>
Loading