Skip to content

Commit

Permalink
009: Wolverine source generation
Browse files Browse the repository at this point in the history
  • Loading branch information
pawlos committed Jun 21, 2024
1 parent 14006a2 commit bb4b19a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ List of the daily tips
- [Day-005](./tip-005/README.md) - Wolverine registration rules
- [Day-006](./tip-006/README.md) - Are we interface obsessed?
- [Day-007](./tip-007/README.md) - MemberNotNullWhen
- [Day-008](./tip-008/README.md) - Log injection
- [Day-008](./tip-008/README.md) - Log injection
- [Day-009](./tip-009/README.md) - Wolverine source generation
13 changes: 13 additions & 0 deletions tip-009/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 009 - Wolverine source generation #

Back to Wolverine topic. One of the interesting (or unique) feature is that Wolverine can work in a fashion that our bindings are source generated. If we are in the development mode that's not very beneficial as we would be generating based on a constantly changing code but once we are fairly done we can use the magic of source generation and get rid of reflection for resolving the handlers. Link to the docs: https://wolverine.netlify.app/guide/codegen.html

The topic of source generating parts of the previously dynamic code is something we will see more and more often.

```csharp
builder.Host.UseWolverine(options =>
{
// use Auto to generate/load generated types or Static in Production to load
options.CodeGeneration.TypeLoadMode = TypeLoadMode.Auto;
});
```

0 comments on commit bb4b19a

Please sign in to comment.