Re:.NET Blazor
by CharlieDigital on Tuesday November 21, 2023 @11:21AM
(#38365708)
I do the same.
I have a small write-up here: https://chrlschn.dev/blog/2023/10/end-to-end-type-safety-wit...
You get end-to-end type safety (even better once you connect it to EF Core since you get it all ways to your DB).
With this setup with hot-reload (currently broken in .NET 8 [0]), productivity is really, really good. Like tRPC but with one of the most powerful ORMs out there right now.
I do the same in Django with drf-spectacular. I have a precommit hook that autogenerates (fairly thin) TypeScript schemas and routes on commit. This is not take merit from LOB devs who want to use C# back-to-front. I will use it as an argument to those who say that this is why you should go full TypeScript on any new web project though.
N.B. the last commit/release for Swashbuckle was Jan this year.
https://github.com/RicoSuter/NSwag might be a better choice for a new project. It look much more maintained and active than Swashbuckle
I've been using this now for several projects, it's a great way to have all the power of TS for client side and C# for server side.
https://www.npmjs.com/package/swagger-typescript-api
https://www.nuget.org/packages/Swashbuckle