August 2018
Intermediate to advanced
298 pages
5h 33m
English
We create query objects instead of using linq because these kinds of queries are associated with the business logic, and wrapping queries into objects allows us to reuse them as well as unit test them. Also, naming them with a class gives us more clues about the purpose of the query rather than on-the-fly queries.
Follow these steps to create a query for the registration service:
In the Queries folder of the Application project, we create a UserExistsQuery class, as follows:
using RestBuy.Entities;using System;using System.Linq.Expressions;namespace RestBuy.Application.Services.Queries{ class UserExistsQuery : BaseQuery<User> { public UserExistsQuery(string ...Read now
Unlock full access