- Home
- .NET code examples
.NET code examples
AppSettings.json example in .NET and C#
Download our appsettings.json example which focuses on how to read a value, using ConnectionString, environment and logging.
Data Annotation custom validator in ASP.NET Core
Download a Data Annotation custom validator written in C# that can be used in .NET with MVC and Web API for model validation.
A FromBody and FromQuery sample in ASP.NET Core Web API
An ASP.NET Core example of using the FromBody and FromQuery attribute. Handy if your request is null, or getting a 415 error.
Download a Blazor WebAssembly button onclick event example
Use a Blazor Wasm parameter to pass the onclick event to another Razor compoment and use it async. Download the code example.
Dynamic queries using LINQ expressions
Writing dynamic queries for Entity Framework. A sample .NET 5 MVC application, showing examples of LINQ expressions.