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)
Let’s see how we can use pdf.co API to convert the same HTML using C# (.net)
If you wanted to unit test a Repository that uses a DbContext with seeded data, you can use the InMemoryDatabase.
Let see how we can integrate the Microsoft Exchange (AKA EWS) and access the information.
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.
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.
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.
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.
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.
Registering the DbContext in order to use it throughout the application as ServiceLifetime.Transient
Writing an extension for removing pluralisation of table names in Entity Framework Core extensions.
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 […]