Custom Configuration Providers in ASP.NET Core

A friend of mine has a requirement in which he was interested to put the configuration settings of an ASP.NET Core application inside a SQL Server table and read them at startup of the application with a mechanism similar to what we already have for json files; also he wanted to have the ability that these variable being overridden or override other settings if applicable. In this article I am going to describe how that could be achievable and how to implement such feature.

Read More

Generate/Validate JSON Web Tokens(JWT) in ASP.NET Core

Last week there was a requirement within one of our backend teams to generate and validate JWT without using IdentityServer4. I vividly remember that last year I have seen such same requirement in another company and they have manually done so many steps to do so and it was a painful process for them to achieve that goal. Here in this article we will discuss how one might have such feature in their API using built-in classes and functionalities in ASP.NET Core.

Read More

Ensure Uniqueness of Nullable Columns

A couple of weeks ago I encountered a tweet in which one of the questions expected from a candidates in a job interview was the reason to write this post, How do you ensure that duplicate keys are prevented on a column that allows NULL values?

That reminds me of the time that I was focused on databases and I had to handle such problem for one of our databases, here we are going to talk about two approaches to address this issue in SQL Server.

Read More

Explore Shadow Properties in EF Core

In the previous post we discovered Query Filters, a feature for EF Core 2.0 and later. Now I want to take a look at another popular feature Shadow Properties. When designing applications we tend to keep our code clean and simple, however there are times that you need to add properties other than what is required in your main business use cases, CreatedOn and LastUpdatedOn are such well-known properties.

Read More

Explore Global Query Filters in EF Core

In this article we are going to check one of the features of Entity Framework Core, Global Query Filters; this was introduced first in EF Core 2.0 and is just a query predicate that will be appended to the end of where clause for queries on entities for which this feature has been activated. Some common scenarios would be Soft delete and Multi tenancy.

Consider that you are writing an application in which entities can be soft deleted, why not completely delete those entities?

Read More

Aurelia Component Communication, Leverage Services, Part 2

Hello guys, I hope you have found part 1 of this article useful, we used properties of our services to store the states we required in our application. However, in the previous part there was two problems, first, the properties using services’ properties are dirty checked, and that’s not good at all, we can add @computedFrom attribute on top of them to inform Aurelia that these properties rely on changes of other properties so the change management mechanism will handle it properly, In vNext that is not necessary as the framework will detect them automatically. Next, there are times that we may not use properties in the views, if so, then our components won’t get notified when the properties they depend upon change, that’s where EventAggregator and aurelia-store come to play. Let’s find out more about them.

Read More

Aurelia Component Communication, Leverage Services, Part 1

Hello and welcome! In this post I want to discover how you can take advantage of services to make components of your application talk to each other. This is inspired by what Mrs. Deborah Kurata explained here and I have tried to adapt it to the world of Aurelia. I have created a Github repository so that you can use it to follow up with this post. I am a great fan of typescript which is used in the sample, besides I also used aurelia-toolbelt as the UI library with the aurelia-cli configured with built-in bundler and no tests. Shall we start? Let’s do it!

Read More

Secure your Aurelia app with IdentityServer

Hello and welcome! Today I want to describe how we can secure our Aurelia applications with the help of an Authorization Server, in this case, IdentityServer4. I hope you enjoy 🙂 the topic and find it fruitful for your applications. The topic is twofold, how to run IdentityServer4, and how to configure Aurelia to be able to communicate with our ISP( Identity Service Provider ). We are using one of the awesome plugins of Aurelia to do so; aurelia-open-id-connect, many thanks to Mr. Shaun Luttin for all his efforts. You can download the source code of this post from my Github repository.

Read More

Chat Application using Aurelia and SignalR

Hello and welcome! You have definitely heard of SignalR for real-time web applications, in this post I want to help you write a simple traditional chat application using SignalR and my favorite SPA framework Aurelia. You can download the source code from my GitHub, here, notice that in this sample we use WebPack for bundling.

Read More