From b7ca0aaf406bf88710adfdbaa21637212b81d726 Mon Sep 17 00:00:00 2001 From: hamza sallakh <114252933+HamzaSallakh@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:32:32 +0300 Subject: [PATCH] change the is satisfied and to expression examples --- .../architecture/domain-driven-design/specifications.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/framework/architecture/domain-driven-design/specifications.md b/docs/en/framework/architecture/domain-driven-design/specifications.md index 867080b86e..68ff038b7e 100644 --- a/docs/en/framework/architecture/domain-driven-design/specifications.md +++ b/docs/en/framework/architecture/domain-driven-design/specifications.md @@ -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)) { @@ -120,7 +120,7 @@ namespace MyProject _customerRepository = customerRepository; } - public async Task> GetCustomersCanBuyAlcohol() + public async Task> GetCustomersCanBookRoom() { var queryable = await _customerRepository.GetQueryableAsync(); var query = queryable.Where( @@ -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. \ No newline at end of file +- **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.