Why you should not use Authorize attributes to protect your API endpoints

Protecting ASP.NET Core WebAPI without using Authorize attribute
Authentication is an essential component of pretty much any REST API. Most of the resources you expose through REST API services, unless they are protected inside intranet, need to be protected by some kind of authentication. This is pretty much clear and it is easy achieved by just simply decorating your controller actions or even whole controllers with Authorize or AllowAnonymous attributes. ...read more

Reading coordinates from the photo in .NET Core

Accessing GPS coordinates metadata of a photography using C# and .NET Core
Pretty much all models of digital cameras including smartphones have ability and usually by default store additional metadata along with the image itself taken. This data is stored in EXIF format and you can easily see it if you are a Windows user by checking the properties of the photography file. ...read more

How to have a REST with Azure serverless functions

Building REST API services with Azure Functions Serverless model
Serverless model is becoming more and more popular everyday and all major cloud providers like AWS, Azure and GoogleCloud are providing their own implementation of serverless cloud computing model. As more and more companies are shifting their infrastructure to cloud, serverless model becomes more and more popular mostly because it's cost effectiveness, easy setup and out of the box scaling and orchestration...read more

Speech to text mp3 audio files using Azure Cognitive Services and .NET Core

Transcribe mp3 audio files to text using Azure SpeechServices and C#
There is a big buzz about AI these days and major Cloud vendors like Amazon Web Services, Azure, Google Cloud are competing to bring better products to their platforms for variety of AI tasks. One of these services is speech recognition and generating transcription text from the audio. I recently worked on a project which involved transcribing large amount of daily generated audio recordings...read more

Running .NET Core on Raspberry PI with Raspbian Stretch

Setting up .NET Core on Raspbery Stretch Linux distribution running on Raspberry PI
Apart from running on Windows and Linux both x86 and x64 architecture, .NET Core is an ideal platform for IOT (Internet of things) projects because it can also run on ARM32 and ARM64. This means you can run it pretty much any device with both RISC or CISC processor architecture. If you are .NET developer or you are familiar with .NET platform and C# language, this means you can now write applications that run on Raspberry Pi which is based on RISC architecture by writing them in Visual Studio...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
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
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
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
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


read more


read more

Umbraco CMS

read more


read more