Tagged articles
Image from Pexels

Tagged articles - ASP.NET Core

Found 58 articles tagged with ASP.NET Core

Partial update with PATCH using DTOs and AutoMapper in REST WebApi
How to partially update an entity in REST WebApi services with ASP.NET Core
0
Implementing partial updates on the REST API is probably the trickiest method to implement. Unlike PUT HTTP method where you pass the whole DTO when you are updating an entity, PATCH method is intended to update only one or few properties of the entity you want to apply change to...read more
Filtering and paging collection result in ASP.NET Core Web API
Paging response data in ASP.NET Core WebApi projects
0
Paging a REST API response is equally important as filtering the data returned through REST API endpoints and they quite often come together. Just like filtering, paging limits the amount of data returned from the endpoint, saving both client and server side resources...read more
The best option to use for a return type in ASP.NET Core WebAPI controller
Choosing the proper return type for WebApi controller actions
0
Starting from .NET Core version 2.1, there are so far three types of WebApi responses that controller actions can return. All three types had it's own pros and cons but all are lacking in options to satisfy both REST and the high level of testability. The available response types in ASP.NET Core including recently released 2.2 version are ...read more
Registering multiple implementations of the same interface in ASP.NET Core
Multiple implementations of an interface in .NET Core Dependency Injection
0
Starting from it's initial release ASP .NET Core comes with built in dependency injection (DI) to help implement Inversion Of Control design pattern. This is not something new in .NET and apart from built-in DI in .NET Core, there are other libraries which provide same and in some cases even more advanced dependency injection implementation...read more
Setting up Kestrel port in configuration file in ASP.NET Core
Reading port from configuration file in Program class Main method
0
When running ASP.NET Core application as self-hosted using Kestrel, it will by default use port 5000 for listening for requests. This should not be a big issue since you can always proxy requests to port 5000. Problem occurs when you might want to have multiple applications on one host, or you simply cannot use port 5000 for security or any other reasons.Luckily, default port for ASP.NET Core application running on Kestrel can be easily changed, but in order to make it easily configurable there are few changes you need to make in your code in order to access IHostingEnvironment and IConfiguration implementation instances combined. ...read more
Using DisplayName attribute for model validation output in ASP.NET MVC Core
Returning DisplayName attribute value in model validation response in MVC Core
0
Model validation is an important part of request life-cycle and pipeline in MVC Core regardless whether you are building Web API project or ASP.NET MVC web application. Both project templates rely on the common ASP.NET Core platform therefore validation is pretty much the same in both type of projects. Because Web API and micro services are more popular nowadays, I am going to use Web API sample project to demonstrate how to modify validation response in MVC Web API Core project. ...read more
Dependency injection with custom MVC filter attributes in ASP.NET Core
Using dependency injection with custom ExceptionFilterAttribute in ASP.NET Core
0
Apart from adding your own middleware to the ASP.NET MVC Core application pipeline, you can control the response using custom MVC filter attributes and selectively apply them to either whole controller or controller actions. One of the commonly used MVC filter in ASP.NET Core is ExceptionFilterAttribute for handling error response in Wep API applications. It is easy to implement and I also wrote an article about Error handling in ASP.NET Core Web API few months ago...read more
Adding healthchecks just got a lot easier in ASP.NET Core 2.2
Setting up and using healthcheck endpoints in ASP.NET Core 2.2
0
Health checks or health probes are the crucial part for orchestrating micro services. If you are using Kubernetes for orchestrating containerized application instances or you just have multiple ServiceApps or VMS behind the load balancer, you need to define health checks in order for the orchestrator or load balancer to know to which instance to send the traffic and to which not...read more
Extending Serilog with additional values to log
Adding additional information to log in .NET Core application with Serilog
0
If you are building .NET Core application your choice for logger library is most likely Serilog. It is really powerful and easy to use library which allows you easy logging in all levels in your application. One of the best features it has is easy extending of the data you want to have in your logs...read more
Using custom request and response serializers in ASP.NET Core
Configuring input and output serailzer/deserialier in ASP.NET Core pipeline
0
This is not a new subject and the support for handling WebApi input and output was introduced in .NET Core 2.0 and it's been there since then. There are couple of useful pages out there and it is even well documented on Microsoft official page Custom formatters in ASP.NET Core Web API...read more
Minify ASP.NET MVC Core response using custom middleware and pipeline
Html response content minification on the fly in ASP.NET Core
0
For my website, since it runs on Umbraco 6 and it is basically ASP.NET MVC application. To reduce load time and increase website performances I decided to alternate the response of the application and minify it using simple regular expression. Initially I was trying to do this with YUI Compressor library which has .NET port as NuGet YUICompressor.NET which works fine in most of the cases, but in my case does not skip PRE tags which I use for code snippets on the website...read more
Background working scheduled task in ASP.NET Core MVC application
Using Quartz for scheduling background tasks in .NET Core MVC applications
0
Caching common data like lookups for example in memory of your app can increase significantly your MVC web application performances and response time. Of course this data has to be periodically refreshed. You can use various approaches to refresh data including expiry, but this can create potential bottle necks in your application since once data expires, you will use request thread to pull the data, cache and serve the request response back...read more
Request Filtering in ASP.NET Core using Middleware and request pipeline
Filter requests in ASP.NET Core application through request pipeline configuration
 
0
ASP.NET Core comes with advanced request processing thrugh pipepline configuretion of the .NET Core middleware elements. You can easily specify the steps that will be exscuted on the request object all the way until the response is returned back...read more
How to get client IP Address in ASP.NET Core 2
Fetching client IP address in ASP.NET Core
0
As ASP.NET was evolving, there were different ways accessing client IP address from the request. The way to do it WebForms and MVC Web application is simply accessing request of the current HTTP context ...read more
Loading RSA key pair from PEM files in .NET Core with C#
BouncyCastle wrapper for loading RSA keys from PEM files instead of XML files
0
Recently I wrote and article about using asymmetric keys for token based authentication in ASP.NET Core. As I was setting up the RSA keys to test the demo appliation I kept running to some challanges that did not make thigs going so smooth Challenge number 1 - OpenSSL ...read more

.NET

read more

JavaScript

read more

SQL/T-SQL

read more

Umbraco CMS

read more