Starting our .NET Core WebAPI Journey – Step 1
As we embark on this journey of .NET Core & WebAPI, I
think getting a high-level overview of what we want to accomplish is ideal to
get us started. Let’s refresh what we
said in that first article and refine it a little further. This is what we said:
I don’t want to do a simple
‘Hello World’ example where we build something but it has no value. I’d like to walk through this journey
creating a real-world application with some of the layers I’d create. So, let’s start with this:
·
Create a .NET Standard Business class library
using Entity framework
·
Create a .NET Core WebAPI which uses our .NET
Standard library. We’ll set this up just
as if you are doing it for real. We will use Dependency Injection, AutoMapper to
convert our objects and define our settings in the appsettings.json file.
Now taking this further, lets define a semi real-world
experience. If you noticed one of my
first articles on LinkedIn, it was about setting up a background process on a
Raspberry Pi. I’m still very interested
in that so I’d like to use this journey to build some services to call from
that background process. My real-world problem comes back to a few topics I’ve
seen from building solutions over these years. One of them comes from logging or
testing certain features and a second one comes from managing our emails being
sent from different solutions. A good
example of the email issue is, I used to do eCommerce transactions and during
the checkout process, we discovered how long it took for the customer to click
on checkout button and then for the confirmation view/page to return. The sale needed to complete and during that
time, we sent one or more emails to the customer and to our vendor fulfilling
the sale. The biggest issue was the
amount of time to complete the entire process.
I always wanted a way to “push” or queue the emailing logic onto a background
process to handle speeding up the confirmation page. I also thought that technically
had no bearing on the eCommerce Transaction as well. What we’re going to eventually
build is a Raspberry pi, running a background process to fulfill the emails and
also log the background processes events.
This way, we can get information or errors that are going on within the
Raspberry Pi.
So, thinking about this application and wanting to build it
in a real-world process, I’m initially thinking of building a .NET Standard
Client Library. This will use Entity
Framework to access the database and also have the ability to send the emails. I want to build this in .NET Standard as I
may want to reuse this functionality in a .NET Framework solution someday. Once our Class library is complete, we’ll
look to create our WebAPI Services.
I’m a huge fan of Step by Step guides while learning so
while we are on this Journey, we’re going to do a few things to hopefully help myself
and you learn. We’ll create a more
detailed Step by Step guide of our solution so you can follow along. We’re going to upload everything into GitHub
at the end so its FREE for you to use and enhance. I’m going to keep documenting our Journey. This way, you can understand some of the
challenges I faced as well as Links and articles I found extremely
helpful.
Comments