New Series: Creating APIs in .NET

While I’m still happily ensconced at CNH Industrial, I have changed my job. I’m no longer writing mobile applications (for the first time in about 7 years!) but rather am writing APIs using ASP.NET Core and C#. -The plan is to have a book on creating APIs (how-to, best practices, patterns, etc.) next year. In the interim, I’ll be writing a series of blog posts covering such topics as how to get started, software and tools you’ll need, REST, and much more.

As part of this series, I’ll create a dead-simple real-world example of a car selling and buying application, suggested by Daniel Brevitt (technical editor of .NET MAUI For C# Programmers). This application will consist of four major parts:

  • The backend SQL Server database
  • The front end for administrators (for inventory, etc.)
  • The front end for customers (for buying or selling)
  • The API that connects the front end to the back end

We’ll create a very simple SQL database using SQL Server and SSMS, and take advantage of Dapper: a simple ORM (Object Relational Model). We will not cover Entity Framework as our focus will be on the APIs, not the back end.

Similarly, the front end will be a very simple application — though at first I’ll simply use Postman rather than building out the front end. In fact, given how important and powerful Postman is, I may never get around to building a real front-end. Getting familiar with the Postman is more important for our purposes.

We will build three types of APIs

  • Traditional APIs built using controllers in ASP.NET Core and .NET 7/8
  • Minimal APIs
  • Azure Functions

My focus in the first posts will be on the first two types, so that we can work locally without having to use Azure for now (there are tools for working with Azure functions locally, but we’ll hold off on that). In fact, we’ll create such a simple database that you can recreate it locally (and I’ll put all the code for this series up on GitHub).

For these posts, I anticipate developing on Windows using:

  • Visual Studio 2022
  • C# – probably nothing more advanced than C# 7 or 8, though bits of later versions may appear from time to time
  • SQL Server (latest)
  • SQL Server Management Studio (SSMS) that comes with SQL Server
  • Postman (latest)
  • Dapper (latest)
  • AutoMapper

All of the software we’ll be using is free (the community editions are fine).

In the next post I’ll create the database and its preliminary tables.

Posted in API, Essentials | Leave a comment

11th MVP award

Pleased and proud to have been awarded my 11th MVP award from Microsoft.

Posted in Microsoft | Leave a comment

Hey! I was interviewed on WebRush

I had the pleasure of turning the tables and being interviewed on WebRush with Jon Papa et al

https://www.webrush.io/episodes/episode-240-theres-something-net-maui-with-jesse-liberty

Posted in Essentials | Leave a comment

Writing a programmer’s cover letter: ChatGPT

https://www.packtpub.com/article-hub/writing-a-customized-cover-letter-for-a-specific-job-in-minutes-using-chatgpt

Posted in Essentials | Leave a comment

Yet Another Podcast – De Sanctis on APIs

Today I spoke with Valerio De Sanctis, author of Building Web APIs with ASP.NET Core.

Posted in Essentials | Tagged | Leave a comment

Writing Unit Tests with ChatGPT

Just posted on Packt: Writing Unit Tests with ChatGPT

Posted in Essentials | Leave a comment

About that dozen programmer must-haves

I wrote this blog post in September of last year, and looking at it today I realized that I don’t use a couple of these anymore:

1) Resharper: the overhead was borderline too much and most of the refactoring power I used is now cooked into Visual Studio

2) Beyond Compare: never did get the hang of using this for git conflicts. Still searching for the right thing

3) OneNote – lost a lot of data with this and switched back to Evernote. Very happy with the change.

Finally, I still use Git Copilot but would move it to the top of the list. Integrated with Intellisense, it is by far the biggest productivity booster I know of. Can’t wait for CoPilot X!

Posted in Essentials | Leave a comment

New Job!

I have changed jobs within my current company (CNH Industrial). I will no longer be doing mobile programming (for the first time in six years) and will be building APIs and back-end code!

I think you can expect fewer articles on mobile/ .NET MAUI programming, and more on ASP.NET Core, Azure Functions, APIs, Architecture, Microservices, etc.

I’m also scoping out writing a book which may include the following topics:

  • Creating the back end (SQL Server & SQL)
  • Azure (Docker, Azure Functions) & Localhost
  • Designing and creating the Minimal API (architecture, end points, etc)
  • Creating the front end ( .NET MAUI )

The book would assume only that you have some C# experience. We’d also cover tools, setup, and best practices. All of this would be in the context of a non-trivial application.

I’d be very interested in hearing your thoughts on such a book. Please feel free to send me email at jesseliberty@gmail.com.

Posted in Essentials | Leave a comment

.NET MAUI Videos Free

I’ve posted my .NET MAUI For Xamarin.Forms Programmers and Advanced .NET MAUI videos on YouTube.

Posted in .NET MAUI | Tagged , , , | Leave a comment

Prague Comes To Boston

I’ll be presenting at Boston Code Camp on

  • .NET MAUI For Xamarin.Forms Developers
  • Advanced .NET MAUI

This is a free, one-day event on Saturday, April 29, in Burlington, MA.

Posted in .NET MAUI | Leave a comment

Advanced .NET MAUI Topic: Visual State

With the release of my newest book, .NET MAUI For C# Developers, I’m pleased to present occasional posts on advanced topics. If you are just starting out, however, you may want to take a look at my previous 15 part series in which I learn .NET MAUI or my second series that uses the app (Forget Me Not) that we’ll be using here. Finally, you can find my presentations on .NET MAUI and advanced .NET MAUI on YouTube, here.

Managing Visual State

Every VisualElement has a Visual State. For example, does the VisualElement have focus? Is it selected? Xaml allows you to change the presentation of that VisualElement (e.g., a button) based on that state.

Continue reading
Posted in .NET MAUI | Tagged , , | Leave a comment

Presented in Prague

I presented on .NET MAUI For Xamarin.Forms Programmers and Advanced .NET MAUI in Prague last week, and it was great (Prague, not the presentations).

All went well, but touring Prague was terrific. The city was founded in the 10th century and the architecture reflects a millennium of development. The city is immaculate and while only about ⅓ of the people I tried to talk to spoke English, many of those who did spoke it perfectly. The mass transit system is fantastic and the sites are literally awesome.

I’m very grateful to have had this opportunity.

Speaking at .NET MAUI Update
Posted in .NET MAUI, Essentials, Presentations | Leave a comment