Skip to content

Commit

Permalink
Merge pull request #21091 from HamzaSallakh/dev
Browse files Browse the repository at this point in the history
change the is satisfied and to expression examples
  • Loading branch information
hikalkan authored Oct 18, 2024
2 parents b7e9667 + b7ca0aa commit b2878b4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace MyProject
{
public class CustomerService : ITransientDependency
{
public async Task BuyAlcohol(Customer customer)
public async Task BookRoom(Customer customer)
{
if (!new Age18PlusCustomerSpecification().IsSatisfiedBy(customer))
{
Expand Down Expand Up @@ -120,7 +120,7 @@ namespace MyProject
_customerRepository = customerRepository;
}

public async Task<List<Customer>> GetCustomersCanBuyAlcohol()
public async Task<List<Customer>> GetCustomersCanBookRoom()
{
var queryable = await _customerRepository.GetQueryableAsync();
var query = queryable.Where(
Expand Down Expand Up @@ -254,4 +254,4 @@ Some benefits of using specifications:
### When To Not Use?

- **Non business expressions**: Do not use specifications for non business-related expressions and operations.
- **Reporting**: If you are just creating a report, do not create specifications, but directly use `IQueryable` & LINQ expressions. You can even use plain SQL, views or another tool for reporting. DDD does not necessarily care about reporting, so the way you query the underlying data store can be important from a performance perspective.
- **Reporting**: If you are just creating a report, do not create specifications, but directly use `IQueryable` & LINQ expressions. You can even use plain SQL, views or another tool for reporting. DDD does not necessarily care about reporting, so the way you query the underlying data store can be important from a performance perspective.

0 comments on commit b2878b4

Please sign in to comment.