Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Programming APIs with C# and .NET

You're reading from   Programming APIs with C# and .NET Develop high-performance APIs that ensure seamless application communication and enhanced security

Arrow left icon
Product type Paperback
Published in Nov 2024
Publisher Packt
ISBN-13 9781835468852
Length 166 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Jesse Liberty Jesse Liberty
Author Profile Icon Jesse Liberty
Jesse Liberty
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Chapter 1: Getting Started 2. Chapter 2: What We’ll Build FREE CHAPTER 3. Chapter 3: Implementing with REST 4. Chapter 4: Documentation with Swagger 5. Chapter 5: Data Validation 6. Chapter 6: Azure Functions 7. Chapter 7: Azure Durable Functions 8. Chapter 8: Advanced Topics 9. Chapter 9: Authentication and Authorization 10. Chapter 10: Deploying to Azure 11. Chapter 11: What’s Next? 12. Index 13. Other Books You May Enjoy

Getting set up

You can create your backend, API, and frontend on any operating system you like. For this book, we’ll be creating all three on Windows, using Visual Studio 2022, the latest Postman, and Dapper as a simple Object Relational Mapper (ORM) to make our lives easier. There are a few other simple tools we’ll be using, so let’s get you set up.

Downloading the free software you need

To get started, if you don’t have Visual Studio installed, go to https://visualstudio.com and click on Downloads (this site changes frequently but the basic steps remain the same). You have three choices of which version to download: Community, Professional, and Enterprise. The Community version is free and will provide all you need to follow along in this book.

When you click on your choice, Visual Studio Setup will download to your downloads directory. Double-click on it and click on Yes at the security prompt. The installer will update itself and then will begin the installation. This can take a little while, but don’t go away as you have some selections to make.

Note

If you have Visual Studio installed but for some reason want to install the Community Edition as well, that is no problem as they can run side by side.

A menu will appear similar to Figure 1.1 (if it does not, click Modify).

Figure 1.1 – Setting up Visual Studio: please note that this screenshot intends to show the layout, so text readability is not essential

Figure 1.1 – Setting up Visual Studio: please note that this screenshot intends to show the layout, so text readability is not essential

Be sure that ASP.NET and web development is checked. Scroll down and check Data storage and processing (if you are short on disk space, skip this one). Once you are satisfied, click on Install while downloading and then click on Modify.

SQL Server will be installed for you, as will SQL Server Management Studio (SSMS). You will typically interact with SQL Server through SSMS. We will look at how to work with this tool, and all the others, as we go.

Your next tool is Dapper. This is a small, lightweight ORM (often called a micro-ORM) that does one important part of the work of the much bigger SQL platform, Entity Framework, but with much less overhead. Specifically, Dapper will map queries to objects.

Since our needs will be minimal, Dapper will be more than enough. You can read more about Dapper here: https://www.learndapper.com/.

We will mimic our user interface with Postman, which we will also use for end-to-end testing. You can get the latest version of Postman at https://postman.com/downloads. You can also access Postman through your browser, but we’ll be using the downloaded version.

Postman is surprisingly powerful, and we will review how we will use it as we go along. That said, we will only scratch the surface of what you can do with this tool, so at some point, you may want to read the documentation.

We will be using Swagger for documentation (see Chapter 4), and the built-in logger functionality for (surprise!) logging errors and issues that will not be surfaced to the user, but which will be useful for you as the programmer.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image