ForEvolve

A piece of mind...

Design Patterns: Asp.Net Core Web API, services, and repositories

Part 2: Dependency Injection

Design Patterns: Asp.Net Core Web API, services, and repositories

In the first part, we visited a few concepts that we will start applying in the next article. But before that, we will do a little interlude about Dependency Injection.

If you are already familiar with Dependency Injection in Asp.Net Core, feel free to jump right to the next article of the series.

In this article, we will cover:

  • Dependency Injection Basics
  • Constructor Injection
  • Scopes (dependencies’ lifetime)
  • Asp.Net Core default DI container
Continue reading...

Design Patterns: Asp.Net Core Web API, services, and repositories

Part 1: Introduction

Design Patterns: Asp.Net Core Web API, services, and repositories

In this article series, I’d like to go back a little (from my previous Microservices Aggregation article which was more advanced) and introduce some more basic design patterns. Those patterns help decouple the application flow and extract its responsibilities into separate classes.

The goal is to give each class a single unique responsibility, which will help us follow the Single responsibility principle. See the SOLID principles for more information.

Continue reading...

How to use a custom NuGet feed in Visual Studio 2017

How to use a custom NuGet feed in Visual Studio 2017

This article will be very brief. In it, I will show you how to use the ForEvolve Framework feed. This could be applied to any other NuGet feed, including your own. Take a look at MyGet if you want one :smile:.

Continue reading...

Microservices Aggregation

Microservices Aggregation

A few weeks ago I had to put together a one hour talk about something IT related. To make the introduction quick: I ended up talking about Microservices.

In that talk, to demonstrate a few things, I created some code samples using .NET Core, available at GitHub. I implemented different services, coded using multiple coding styles. Some services are easier to understand for beginners while others are more “complex” and more testable.

I also briefly talked about an alternate way to start building a product using Microservices for small teams. I will introduce and discuss this pattern more in depth here.

This technique could also be applied to any MVC project where you want to divide domain boundaries into multiple assemblies.

Microservices

I will not cover the basics of the Microservices design pattern here; I will leave that to others, such as Martin Fowler, microservices.io and Google.

So, basically, in a Microservices design, you trade coupling for operational complexity.

While enjoying the fact that every service is decoupled from one another, it can rapidly become hard to manage. Particularly for a small software, a small team, a small business or a startup (noticed the keyword “small” here?)

Nevertheless, aligning your software with the Microservices mindset could bring some advantages over a more Monolithic approach, even for a tiny company.

Continue reading...

Goodbye WordPress! And welcome GitHub Pages!

Goodbye WordPress! And welcome GitHub Pages!

I have never been a huge fan of WordPress and today is the day that I go back to a life without WordPress. At least now, no one can say that I didn’t try.

What drove my decision

Let’s start with my initial requirements:

A blog engine with Markdown and Multilanguage support.

What was WordPress

A CMS-ish/blog-engine, plugin-based, very slow, that also needs

Continue reading...

Some essential keyboard shortcuts and mouse tips that everyone should know to be more productive

Some essential keyboard shortcuts and mouse tips that everyone should know to be more productive

Based on what I saw in the field, from beginners to senior professional developers, many people could be more productive when it comes to text selection.

There are a few things that can help you write what’s in your mind faster (most of the time: code):

  1. IntelliSense/autocomplete (ctrl+space + up/down arrows + tab or enter or . or …) - this is a topic for another day.
  2. Code snippets (i love my guard, aaa (arrange, act, assert) snippets) - another topic for another day.
  3. The use of your keyboard (i.e.: shortcuts)

The keyboard shortcuts presented here can be useful to anyone but are more focused on programming.

Adding these in your day to day work should boost your productivity, allowing you to think more of your results and less about the process to get there.

Continue reading...

How to add your PHP runtime directory to your Windows 10 PATH environment variable

How to add your PHP runtime directory to your Windows 10 PATH environment variable

Today I will explain how to add your PHP runtime directory to your Windows 10 PATH environment variable. This will give you global access to php.exe from any command prompt.

Please note that you must reopen your command prompt windows (if you had any open prior to the update).

Command prompt loads the PATH environment variable when it is first open.

Target audience

  • Windows 10 users
  • PHP developers that want PHP to be globally accessible from any command prompt (ex.: php.exe for “linting” or to start a dev. server)

Note that you are not limited to PHP, this can be any directory containing any program - ex.: npm

Continue reading...

How to trick the EDM model builder to allow recursive ComplexTypes

How to trick the EDM model builder to allow recursive ComplexTypes

Before starting, this article is built on top of How to create an OData reporting service in ASP.NET 4.5 but you can easily adapt it to any of your project. The code is in the same git repository as the previous article, in the branch recursive-complex-type, on GitHub.

  1. The problem
    1. The model
    2. The configuration
    3. The failure
  2. Some added realism
    1. The new application
    2. The new and updated classes
  3. The solution
    1. The models
    2. Yeah, it worked!
  4. Conclusion
Continue reading...

Opérations Git de base en utilisant le client de GitHub

Opérations Git de base en utilisant le client de GitHub

Table des matières

  1. Comment clone un repo git GitHub
  2. Comment changer de branch
  3. Voir l’historique des modifications liste des commits
  4. commit ses changements
  5. push et pull
  6. L’état de la synchronisation
  7. L’état des fichiers avant un commit
  8. C’est la fin
Continue reading...

How to create an OData reporting service in ASP.NET 4.5

How to create an OData reporting service in ASP.NET 4.5

Before starting, I will assume that:

  • You know what OData is (at least a bit).
  • Have basic knowledge of Visual Studio, NuGet, ASP.NET, MVC5 and C#

What we will do is:

  1. Create a project
  2. Install dependencies
  3. Create some files and write some code
  4. Create a basic Model
  5. Create a basic Controller
  6. Create OData configuration
  7. Consume our OData service in a browser
  8. Some explanations
  9. Consume our OData service in Excel 2016
Continue reading...