Menu
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.

Creating a Model for an Existing Adventure Works Database in Entity Framework Core

Creating a Model for an Existing Adventure Works Database in Entity Framework Core

Recently I started playing around with Odata and wanted to fast track development with an existing database. I don’t want to waste time on data and the database structure, rather I spend time on asp.net core oData.

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.

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.

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

Entity Framework Core extensions remove pluralisation of table name

Entity Framework Core extensions remove pluralisation of table name

Writing an extension for removing pluralisation of table names in Entity Framework Core extensions.

Entity Framework Core extension to Execute Stored procedure and get results back

Entity Framework Core extension to Execute Stored procedure and get results back

Since Entity Framework Core is fairly new (at the time I am writing) and still under development. Not most of the required features are not there out of the box and you will have to write extensions. I have to utilise an existing stored procedure to get some data from database. I have to use ADO […]