Skip to content

Commit a7a4801

Browse files
committed
Use decimal type for money representation
1 parent b364747 commit a7a4801

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/StructuralPatterns/Facade/FacadeLibrary/MortgageExample/Facade/Mortgage.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public Mortgage()
1818
_customerService = new CustomerService();
1919
}
2020

21-
public bool IsEligible(string customerName, int loanAmount)
21+
public bool IsEligible(string customerName, decimal loanAmount)
2222
{
23-
Console.WriteLine($"Customer {customerName} applies for {loanAmount:C} loan.\n");
23+
Console.WriteLine($"Customer {customerName} wants to apply for {loanAmount:C} loan.\n");
2424

2525
var customer = _customerService.Find(customerName);
2626

src/StructuralPatterns/Facade/FacadeLibrary/MortgageExample/MortgageExecutor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public static void Execute()
1313
var mortgage = new Mortgage();
1414
var customerName = "Mario Balotelli";
1515

16-
// Evaluate mortgage eligibility for customer
16+
// Evaluate mortgage eligibility for the customer.
1717
bool isEligible = mortgage.IsEligible(customerName, 125000);
1818

1919
var status = isEligible ? "approved" : "rejected";

src/StructuralPatterns/Facade/FacadeLibrary/MortgageExample/Subsystem/CustomerService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ public class CustomerService
44
{
55
public Customer Find(string name)
66
{
7-
// Naive implementation
8-
// In real life scenario we need to have customer registry
9-
// There may be multiple customers with the same name
7+
// Naive implementation.
8+
// In real life scenario we would need some customer registry.
9+
// There may be multiple customers with the same name.
1010
return new Customer { Name = name };
1111
}
1212
}

0 commit comments

Comments
 (0)