What did you do last week?

This past week I spent some time working on my main personal website getting to know working in Jekyll and the theme Minimal Mistakes.

I Worked on some .NET tutorials. I discovered there are actually two ways to implement an API in .NET. The main way is the same as the MVC implementation, it is class based and extends the controller class. It’s definitely a “batteries included” full featured way to implement an API much like Django or others. The other way is called a Minimal API, which appears to be more function based. You establish a route and link it to a function to execute. This looks exactly like Flask or Node Express and has very sparse code to get the API working. The minimal API approach is desired for microservices or projects with a narrow scope.

After some initial confustion I completed this tutorial in the docs but afterwards realized the tutorial was too surface level which left me looking for another one. I found this learning module and liked it much better as you built the demo API incrementally. I will definitely look at these training modules first before the tutorials in the documentation next time around. I also played around with the minimal API after learning the class based version. I further explored a little bit the .NET ecosystem which is vast and easily confusing. I listened to a podcast and found some highly regarded introductory books via an interview with the author. I also found this .NET roadmap which has tons of links to learning resources per topic.

For this week my miniproject was a basic API inspired by the tutorials about also on last week’s CLI application. I extended my knowledge by adding a few more routes and classes.

Tutorials Completed:

I did not work on the mock ups for the app as I intended. With API routing on my mind, I instead worked on a rough draft of the break down of API Endpoints for the application. I started with a template from chatgpt.

What do you plan to do this week?

This week I will dive in to .NET’s ORM, Entity Framework Core, aka EF Core, and learn how to connect my API to SQL database. In keeping with the last week’s work on the project planning docs, I will work on the details of the database design for the project as well. I will also be more aware of making sure a tutorial is worth it by skimming it first and making sure it builds on topics iteratively instead of showing you a lot of code and discussing the surface.

Are there any impediments in your way?

I am trying to learn C# as I learn back end development with .NET. I am realizing this can feel jarring as I am confronted with code I don’t understand. I realize the ideal path might have been to spend more time learning C# instead of relying on my experience with C and C++. I might try to incorporate some mini lessons on C# or ask chatgpt for help when I feel overwhelmed by code I don’t understand. It could be this is just par for the course and potentially more real world.

Reflection on the process and improvements

It seems that it take a little time to get rolling with the right learning resource. I hope to reduce this time or schedule it in more mindfully.

Screenshots and API Testing

This week I got to learn about a bunch of fun tools to test APIs. Swagger has a great UI and also helps with created documentation with OpenAPI specification. It also shows you the curl command line text to recreate the same HTTP requests. I also used an HTTP request extension in VS Code which allows you to use .http files and send requests by line. Further I used HttpRepl which is a command line interface for testing .NET APIs. Amazing!

Rest Client VS Code Extension

Rest Client VS Code Extension image

Swagger

Swagger image

HttpRepl

HttpRepl image