Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Web API Development with ASP.NET Core 8
  • Table Of Contents Toc
  • Feedback & Rating feedback
Web API Development with ASP.NET Core 8

Web API Development with ASP.NET Core 8

By : Yan
4.5 (15)
close
close
Web API Development with ASP.NET Core 8

Web API Development with ASP.NET Core 8

4.5 (15)
By: Yan

Overview of this book

Web API applications have become increasingly significant in recent years, fueled by the ever-accelerating pace of technological advancements. However, with this rapid evolution comes the need to create web API apps that are not only functional but also adaptable, maintainable, and scalable to meet the demands of users and businesses alike. This book draws from the author’s immense technical expertise and decades of experience in software development to help you address this challenge head-on, equipping you with the knowledge and skills required to develop web API apps from scratch. By providing a deeper understanding of the various protocols implemented by ASP.NET Core, including RESTful, SignalR (WebSocket), gRPC, and GraphQL, supplemented by practical examples and optimization techniques, such as using middleware, testing, caching, and logging, this book offers invaluable insights for both newcomers as well as seasoned developers to meet modern web development requirements. Additionally, you’ll discover how to use cloud platforms such as Azure and Azure DevOps to enhance the development and operational aspects of your application. By the end of this book, you’ll be fully prepared to undertake enterprise-grade web API projects with confidence, harnessing the latest advancements in ASP.NET Core 8 to drive innovation.
Table of Contents (20 chapters)
close
close

Using raw SQL queries

Although EF Core can translate most LINQ queries into SQL queries, which is very convenient, sometimes we need to write raw SQL queries if the required query cannot be written in LINQ, or the generated SQL query is not efficient. In this section, we will explore how to use raw SQL queries in EF Core.

EF Core provides several methods to execute raw SQL queries:

  • FromSql()
  • FromSqlRaw()
  • SqlQuery()
  • SqlQueryRaw()
  • ExecuteSql()
  • ExecuteSqlRaw()

When we execute raw SQL queries, we must be careful to avoid SQL injection attacks. Let's see when we should use raw SQL queries and how to use them properly. You can download the sample code from the /samples/chapter7/EfCoreDemo folder in the chapter's GitHub repository.

FromSql() and FromSqlRaw()

We can use the FromSql() method to create a LINQ query based on an interpolated string. The FromSql() method is available in EF Core 7.0 and later versions. There is a similar method...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Web API Development with ASP.NET Core 8
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon