Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ASP.NET Core and Vue.js

You're reading from   ASP.NET Core and Vue.js Build real-world, scalable, full-stack applications using Vue.js 3, TypeScript, .NET 5, and Azure

Arrow left icon
Product type Paperback
Published in Jun 2021
Publisher Packt
ISBN-13 9781800206694
Length 478 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Devlin Basilan Duldulao Devlin Basilan Duldulao
Author Profile Icon Devlin Basilan Duldulao
Devlin Basilan Duldulao
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Section 1: Getting Started
2. Chapter 1: Getting Started with ASP.NET Core and Vue.js FREE CHAPTER 3. Chapter 2: Setting Up a Development Environment 4. Section 2: Backend Development
5. Chapter 3: Starting Your First ASP.NET Core Project 6. Chapter 4: Applying Clean Architecture to an ASP.NET Core Solution 7. Chapter 5: Setting Up DbContext and Controllers 8. Chapter 6: Diving into CQRS 9. Chapter 7: CQRS in Action 10. Chapter 8: API Versioning and Logging in ASP.NET Core 11. Chapter 9: Securing ASP.NET Core 12. Chapter 10: Performance Enhancement with Redis 13. Section 3: Frontend Development
14. Chapter 11: Vue.js Fundamentals in a Todo App 15. Chapter 12: Using a UI Component Library and Creating Routes and Navigations 16. Chapter 13: Integrating a Vue.js Application with ASP.NET Core 17. Chapter 14: Simplifying State Management with Vuex and Sending GET HTTP Requests 18. Chapter 15: Sending POST, DELETE, and PUT HTTP Requests in Vue.js with Vuex 19. Chapter 16: Adding Authentication in Vue.js 20. Section 4: Testing and Deployment
21. Chapter 17: Input Validations in Forms 22. Chapter 18: Writing Integration Tests Using xUnit 23. Chapter 19: Automatic Deployment Using GitHub Actions and Azure 24. Other Books You May Enjoy

Writing queries

We will now create our first query, which is a request for reading data, and a query handler, which will resolve what the query needs. Again, the controller is responsible for sending or dispatching the queries to the relevant handlers.

The following is a block of code for ExportToursQuery and its handler. You will see later how the controller will use ExportToursQuery as an argument in the mediator's Send method:

// ExportToursQuery.cs

using AutoMapper;
using AutoMapper.QueryableExtensions;
using MediatR;
…
namespace Travel.Application.TourLists.Queries.ExportTours
{
  public class ExportToursQuery : IRequest<ExportToursVm>
  {
    public int ListId { get; set; }
  }
  public class ExportToursQueryHandler :
    IRequestHandler<ExportToursQuery, ExportToursVm>
  {
    …
    public async Task<ExportToursVm...
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 €18.99/month. Cancel anytime