TypedRouting for ASP.NET Core MVC 2
Today I have released a new version of Strathweb.TypedRouting.AspNetCore. This new version is built as .NET Standard 2.0, and - obviously - finally supports ASP.NET Core MVC 2.
Here is a short summary and some links to help you get started.
[Required] and [BindRequired] in ASP.NET Core MVC
When controlling the binding behavior of models in ASP.NET Core MVC applications, it is very common to perform some validation on them. For that, data annotations are a perfect tool.
One of the most typical use cases of data annotations is to ensure that a value of a certain property has been provided by the caller of the API - and this, historically (in “classic” ASP.NET MVC), has been controlled by RequiredAttribute. The attribute can still be used in ASP.NET Core MVC, but there is also a new one - BindRequiredAttribute.
Let’s have a look at the subtle differences between them.
C# REPL for .NET Core 2.0 and #load support from Nuget – dotnet-script 0.16 is out!
Last week, together with [Bernhard][1] we released version [0.16 of dotnet-script][2], the .NET Core 2.0 C# script runner. I’d like to summarize the new features in this short blog post - as there are two highlights of this release - which we are very excited about!
The project now offers a C# REPL (interactive mode) which can be access when launching dotnet-script without any arguments. All the features of scripting are supported in the interactive mode, including support for adding Nuget references via #r “nuget: {package}”.
The second large feature is support for #load “nuget: {package}”, which works similar to its #r counterpart, except not for assemblies but for referencing CSX files from Nuget.
C# Script Runner for .NET Core 2.0!
As you may have read on this blog before, together with Bernhard, we have been working on a .NET Core and .NET CLI C# script runner, called dotnet-script, for a while now. Today I have a big announcement to make - we have recently released .NET Core 2.0 and .NET Standard 2.0 support!
These changes are part of 0.14.0 release that came out 3 weeks ago. We didn’t want to promote it that much, because - as it’s normally the case with .NET Core related stuff - the accompanying tooling wasn’t ready. In other words, there was no robust language services or intellisense story for writing .NET Core 2.0 scripts.
However, we are now ready with OmniSharp tooling too, which means you can enjoy C# scripting on .NET Core 2.0 in VS Code as long as you install the latest beta release of C# for VS Code. In parallel, we also already released a 0.15.0 version of dotnet-script.
Here is how to get started and a summary of what is new in 0.14.0 and 0.15.0.
Self-issuing an IdentityServer4 token in an IdentityServer4 service
When building logic around the IdentityServer4 extensibility points, it is sometimes necessary to dynamically issue a token, with which your code can then call some external endpoints or dependencies.
Turns out that rather than round-tripping back to same IdentityServer4 instance over the network to get that token, there is a more efficient and quicker way to do it. Let’s have a look.
Solution-wide Nuget package handling in .NET SDK-based projects
In this blog post I’d like to show you a very simple technique for ensuring all your Nuget packages across all the projects in a solution have the same version. Such package management improvement introduced recently into the OmniSharp code by one and only Dustin Campbell, and I’ve also been using it in some of my projects.
If your solution is built around .NET SDK csproj projects, which were introduced in Visual Studio 2017, hopefully this blog post will be useful to you.
Strathweb TypedRouting AspNetCore 1.1.0 released!
Today I have released the 1.1.0 version of Typed Routing project. I encourage you to try this if you like to have your routes centrally configured, rather than stored in attributes at action level.
You can install it from NuGet using the Strathweb.TypedRouting.AspNetCore package name. Here is what’s new in this release.
dotnet-script 0.11 out – with inline Nuget support
Yesterday I released, thanks to the great help of Bernhard - version 0.11 of dotnet-script, the C# script runner for .NET Core.
It is the biggest release yet - with the highlight feature being the ability to use inline Nuget packages.
Here is the overview of what’s in there.
Customizing query string parameter binding in ASP.NET Core MVC
A few years ago I blogged about binding parameters from URI in ASP.NET Web API. One of the examples in that post was how to bind a comma-separated collection passed to your API as a query string parameter.
Technologies change, and we now work with ASP.NET Core (and the MVC Core framework), but problems remain the same - so let’s have a look at how we can customize the way parameters are bound from query string in ASP.NET Core MVC.
Using MessagePack with ASP.NET Core MVC
Some time ago (actually, almost 5 years ago), I blogged about using MessagePack with ASP.NET Web API in order to improve your API’s efficiency over JSON - both in terms of serialization speed and in message payload size.
That code later made it to the WebApiContrib project, where it was released as an add-on to ASP.NET Web API.
I recently had a thought - since we now have WebApiContrib.Core for ASP.NET Core, why not revisit the idea, and create a MessagePack add-on for that too?
About
Hi! I'm Filip W., a cloud architect from Zürich 🇨🇭. I like Toronto Maple Leafs 🇨🇦, Rancid and quantum computing. Oh, and I love the Lowlands 🏴.
Recent Posts
- 2024/11/15, Strathweb Phi Engine - now with Safe Tensors support
- 2024/10/25, How GPT-4o-mini can be simultaneously 20x cheaper and 2x more expensive than GPT-4o
- 2024/10/14, Speech-based retrieval augmented generation (RAG) with GPT-4o Realtime API
- 2024/09/06, Using Local Phi-3 Models in AutoGen with Strathweb Phi Engine
- 2024/08/30, Building a chat app with Blazor WASM, SignalR and post-quantum end-to-end encryption
Categories
- ai (15)
- ai search (5)
- apache cordova (1)
- asp.net 5 (17)
- asp.net core (47)
- asp.net mvc (35)
- asp.net mvc 6 (7)
- asp.net vnext (6)
- asp.net web api (96)
- astronomy (1)
- autogen (1)
- azure (21)
- azure service bus (1)
- azure-devops (1)
- benchmark dotnet (1)
- bing maps (1)
- blazor (2)
- c plus (2)
- c-sharp (155)
- cryptography (5)
- csharp (5)
- csharp 10 (2)
- dnx (3)
- dotnet-cli (2)
- dotnet-script (11)
- duende (4)
- editorconfig (1)
- entity framework (2)
- espn api (2)
- events (1)
- ffi (4)
- fsharp (1)
- git (1)
- glimpse (1)
- html5 (4)
- identity server (2)
- iis (2)
- il (1)
- intro to qc (19)
- ios (5)
- javascript (9)
- jquery (4)
- jquery mobile metro (1)
- katana (2)
- kindle (1)
- knockout.js (8)
- kotlin (2)
- last.fm api (2)
- linq (1)
- mac (2)
- macos (1)
- mathematica (1)
- msbuild (3)
- mvc core (3)
- nancy (2)
- native (1)
- net (141)
- net 5 (3)
- net 6 (5)
- net 7 (7)
- net 8 (3)
- net 9 (1)
- net core (49)
- net sdk (2)
- ninject (2)
- odata (4)
- oidc (2)
- omnisharp (13)
- openai (11)
- osx (2)
- owin (5)
- phi (4)
- php (1)
- q-sharp (34)
- qir (3)
- quantum computing (38)
- roslyn (30)
- rust (5)
- scriptcs (11)
- scripting (9)
- security (8)
- servicestack (2)
- signalr (8)
- swift (8)
- testing (5)
- twitter boostrap (1)
- typescript (1)
- visual studio (4)
- visual studio code (11)
- wasi (3)
- wasm (3)
- windows phone 7 (1)
- wordpress (1)
- wpf (2)