Menu
Richardson Maturity Model in REST API

Richardson Maturity Model in REST API

The Richardson Maturity Model is a model developed by Leonard Richardson in 2008 to categorize and rank the architectural maturity of web APIs based on their adherence to REST (Representational State Transfer) principles. REST is a style of software architecture for distributed systems, often used in web services development.

C# – Convert HTML to PDF using pdf.co API

C# – Convert HTML to PDF using pdf.co API

Let’s see how we can use pdf.co API to convert the same HTML using C# (.net)

C# Unit test a Repository class using a Seeded InMemoryDatabase

C# Unit test a Repository class using a Seeded InMemoryDatabase

If you wanted to unit test a Repository that uses a DbContext with seeded data, you can use the InMemoryDatabase.

C# querying the EWS Managed API from as asp.net core web api

C# querying the EWS Managed API from as asp.net core web api

Let see how we can integrate the Microsoft Exchange (AKA EWS) and access the information.

Unit testing Basic Authentication Handler in asp.net core (C# )

Unit testing Basic Authentication Handler in asp.net core (C# )

Unit testing Basic Authentication Handler in asp.net core (C# ), I will be using the Xunit (my preferred) and Moq, I personally prefer NSubstitute, but the project was already using Moq and I didn’t want to change it.

Using OData paginated payload with ngx-bootstrap Pagination component

Using OData paginated payload with ngx-bootstrap Pagination component

All the OData endpoints have stranded responses, I don’t want to change it. Now I need to do my Angular implementation to support OData stranded.

Using MediatR with Hangfire to pass requests that can be processed in the background jobs

Using MediatR with Hangfire to pass requests that can be processed in the background jobs

I need to move this email sending task out of the HTTP process and run it in the background. Hangfire is a very good solution for all the background tasks.

Posting messages to Microsoft Teams from your C#/ ASP NET Core application

Posting messages to Microsoft Teams from your C#/ ASP NET Core application

Sending emails is bit old and most check emails few times a day. One of the interesting ways of integration is Micrisoft Teams or Slack. These tools are popular among startups as well as enterprise clients.

ASP.NET Core C# API – Register a service dependency that uses HttpClient correctly

ASP.NET Core C# API – Register a service dependency that uses HttpClient correctly

More often we have to call a RESTfull service, it could be simple as sending an email, SMS, posting a message, etc. We use can use an HttpClient for all our HTTP calls. Alternatively, we can use a library such as Restshaper.

C# – Unit testing a AutoMapper Profile mappings

C# – Unit testing a AutoMapper Profile mappings

When you use AutoMapper to map our objects, and AutoMapper profiles are the way we do it, it encapsulates a lot of business logic in some cases. But we need to make sure the business logic gets unit tested.

C# – Unit testing a Mediator handler that has AutoMapper Profile

C# – Unit testing a Mediator handler that has AutoMapper Profile

As part of my Mediator handler, I have multiple dependencies injected they are DbContext, IMapper. But remember, as part of the application initialisation we have AutoMapper Profile registration automatically. But it’s not the case with Unit Testing we need to register the dependencies or mock them. Therefore we need to add the Profile to our IMapper initialisation.

Securing the Windows Azure Storage Blob files with Shared Access Signature

Securing the Windows Azure Storage Blob files with Shared Access Signature

In a previous blog post, I demonstrated how easy to save and delete the file to Azure Blob Storage. If they are just public images its alright to leave them as public, but if they are private images and documents we need to secure them.

Writing Twilio service to send SMS (TXT) Australian mobile number

Writing Twilio service to send SMS (TXT) Australian mobile number

In one of my previous blog post I have put together a service to verify valid Australian mobile number, in this post I will share the service I use to send SMS (TXT) messages to mobile numbers. 

Writing Twilio service to validate Australian mobile number

Writing Twilio service to validate Australian mobile number

Send a SMS (TXT)/Voice message to given mobile number, for SMS (TXT) based  verification will receive a 4 digits number which they will enter back. and that number get validated

Asp.net Cache Core – using in memory cache

Asp.net Cache Core – using in memory cache

Most of the apps we write have some data that not get updated frequently or not get updated at all. For example – suburb list, user roles, etc. We can avoid reading the database for all those entities by using a cached collection.

Entity Framework Core (EF Core) group daily data to monthly

Entity Framework Core (EF Core) group daily data to monthly

I had to create a chart from Chart JS to display, displaying data with Chart JS is super easy, but getting the data from the server is bit tricky unless you are a SQL expert (well not me :)). Below query will group it by month.

How to upload images (jpgs, pngs) from Vuejs to Asp.net core webservice

How to upload images (jpgs, pngs) from Vuejs to Asp.net core webservice

How to upload images (jpgs, pngs) from Vuejs to Asp.net core web service

asp.net core / C# Image Resize Service using ImageMagick NuGet

asp.net core / C# Image Resize Service using ImageMagick NuGet

asp.net core / C# Image Resize Service using ImageMagick NuGet

Creating a C#/ .net service to do Google Places API look up

Creating a C#/ .net service to do Google Places API look up

This code snippet demonstrates how you can create a C# .net service to do Google Places API lookup API

Creating a service to save and delete file in Windows Azure Storage Blob

Creating a service to save and delete file in Windows Azure Storage Blob

Creating a service to save and delete file in Windows Azure Storage Blob

Asp.net Core – User Accessor service to retrieve the current user from the HttpContext

Asp.net Core – User Accessor service to retrieve the current user from the HttpContext

Retrieve JWT claims from Bearer Token in API/MVC

Asp.net Core – Centralising FluentValidation rules to a service

Asp.net Core – Centralising FluentValidation rules to a service

Centralising FluentValidation rules to a service

Asp.net core API – Issue Jwt token upon successful login

Asp.net core API – Issue Jwt token upon successful login

This is a continuation of my previous post of Setting up Asp.net core API for JwtBearer Authentication. This will show how to issue Jwt tokens upon successful login

Setting up Asp.net core API for JwtBearer Authentication

Setting up Asp.net core API for JwtBearer Authentication

Setting up Asp.net core API for JwtBearer Authentication

Asp.net core 2.0 and Entity framework Core – registering DbContext with ServiceLifetime.Transient

Asp.net core 2.0 and Entity framework Core – registering DbContext with ServiceLifetime.Transient

Registering the DbContext in order to use it throughout the application as ServiceLifetime.Transient

ASP.NET Core 2 – reading custom setting from appsettings.json

ASP.NET Core 2 – reading custom setting from appsettings.json

Asp.net core 2 released recently and I wanted to port my existing asp.net 1.1 app to 2.0. Updated the NuGet packages and most things remain same, but I noticed the reading app settings are broken (well there were few others too – may be later.)

Using the string value of a C# enum value in a case statement

Using the string value of a C# enum value in a case statement

Enums much better way compared to hard coding the string. Collection of code snippets using Enums with c# switch statment

Using MailKit to send emails via GoDaddy SMTP on ASP.Net Core app

Using MailKit to send emails via GoDaddy SMTP on ASP.Net Core app

I have an application that needs to send emails, application is coded in c# asp.net core and most of the previous packges I used int he past not compatible with asp.net core. I came across with MailKit seem to be pretty popular for email sending in c#, thought give it a go. install the NuGet […]

Creating a Azure Mobile Service (also using OData) to create a generic BaseController for CURD operations.

Creating a Azure Mobile Service (also using OData) to create a generic BaseController for CURD operations.

Creating a Azure Mobile Service (also using OData) to create a generic BaseController for CURD operations.

Uploading files from Angular 2 and ASP.NET Core Web API – Part 2

Uploading files from Angular 2 and ASP.NET Core Web API – Part 2

This is the part 2 demonstrating how to save the files sent by Angular 2 on ASP.NET Core server

OLDER POSTS