Reader small image

You're reading from  ASP.NET 8 Best Practices

Product typeBook
Published inDec 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781837632121
Edition1st Edition
Languages
Right arrow
Author (1)
Jonathan R. Danylko
Jonathan R. Danylko
author image
Jonathan R. Danylko

Jonathan "JD" Danylko is an award-winning, full-stack ASP.NET architect. He's used ASP.NET as his primary way to build websites since 2002 and before that, Classic ASP. Jonathan contributes to his blog (DanylkoWeb) on a weekly basis, has built a custom CMS, is a founder of Tuxboard (an open-source ASP.NET dashboard library), has been on various podcasts, and guest posted on the C# Advent Calendar for 6 years. Jonathan has worked in various industries for small, medium, and Fortune 100 companies, but currently works as an Architect at Insight Enterprise. The best way to contact Jonathan is through GitHub, LinkedIn, Twitter, email, or through the website.
Read more about Jonathan R. Danylko

Right arrow

Designing APIs

In this section, we’ll cover the best approach for delivering intuitive and clear APIs to our users. The design of an API should be well thought-out and make sense when a user wishes to make a request.

To create a truly REST-based API, we must use a different mindset. We have to think of ourselves as a user and not a developer. When writing APIs, the users of the API are fellow developers.

Disconnecting from existing schemas

When designing APIs, we need a user’s perspective as opposed to basing an API on a class hierarchy or database schema. While developers may consider creating an API based on a class hierarchy or database schema as a shortcut, it could create more complexity as to which resource to use when retrieving data. One example is using an Order resource to find a contact. While an Order entity in Entity Framework Core could contain a Company property and we need the contact of the company, we wouldn’t write https://www.myfakesite...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
ASP.NET 8 Best Practices
Published in: Dec 2023Publisher: PacktISBN-13: 9781837632121

Author (1)

author image
Jonathan R. Danylko

Jonathan "JD" Danylko is an award-winning, full-stack ASP.NET architect. He's used ASP.NET as his primary way to build websites since 2002 and before that, Classic ASP. Jonathan contributes to his blog (DanylkoWeb) on a weekly basis, has built a custom CMS, is a founder of Tuxboard (an open-source ASP.NET dashboard library), has been on various podcasts, and guest posted on the C# Advent Calendar for 6 years. Jonathan has worked in various industries for small, medium, and Fortune 100 companies, but currently works as an Architect at Insight Enterprise. The best way to contact Jonathan is through GitHub, LinkedIn, Twitter, email, or through the website.
Read more about Jonathan R. Danylko