Sending emails is a very important functionality for any website nowdays, either to send account verification emails, newsletter emails or even notification emails. Today I'll be showing how you can create your own EmailSender Service in ASP.NET Core using FluentEmail and Razor templates for rich HTML emails. EmailSender interface If you're working with a project that implements a Clean Architecture, you'll want to create an interface in your Core project to define what you need the service to do, as well as to have the possibility to use it from the Core project too.
26 April / / C# / Programming
Assuming you are familiar with C#; If I give you a Type and tell you to create an object with it, you would automatically think of Activator.CreateInstance right? What if I tell you that instanciating a Type using Expression Trees is much faster? The code for the benchmarks is in this repository.
19 April / / Other
Today I was installing Oh My ZSH and the theme Agnoster and it worked in the the normal terminal but not in Visual Studio Code's terminal, as it needs a monospaced font and Powerline isn't one. In this post I'll explain how to quickly fix it. The problem Problem VS Code defaults the terminal's font to the editor's font, and since the Agnoster theme needs Powerline, the terminal outputs non-sense characters.
13 April / / ASP.NET Core
Checking if a model is valid is pretty an automatic behavior at this point. Whenever a request expects a model, we need to make sure that the validation is good, and we use ModelState.IsValid for that. But that becomes boring, most of the time (if not always) we redirect to the same page, another page or return a bad request in case of an API.
14 March / / Programming
Repository Pattern was first introduced in the Domain Driven Development back in 2004 and has since then gained a lot of popularity. Today I'll show you how you can implement a generic async version of it in C# (ASP.NET Core specifically). The code of this blog post is available here.
08 February / / Other
I bought a laptop a long time ago but I never really used it enough to notice this. I am now using it every day and every time a Windows 10 notification shows up, both my ears bleed (not really but you get the idea). The volume of these notifications is EXTREMELY loud.