public class BaseDiscountService
public double GetDiscount(int id) => id > 100 ? 0.9 : 0.95;
public class OrderService
public bool HasEnoughOrders(int id) => id > 50;
public class DayOfWeekService
public double GetDayOfWeekDiscount() => DateTime.Now.DayOfWeek == DayOfWeek.Sunday ? 0.9 : 1.0;
public class DiscountFacade
private BaseDiscountService _baseDiscountSvc = new();
private OrderService _orderSvc = new();
private DayOfWeekService _dayofweekSvc = new();
public double GetDiscount(int customerId)
if(_orderSvc.HasEnoughOrders(customerId))
return _baseDiscountSvc.GetDiscount(customerId) * _dayofweekSvc.GetDayOfWeekDiscount();
public static void Main()
DiscountFacade discountFacade = new();
Console.WriteLine(discountFacade.GetDiscount(10));
Console.WriteLine(discountFacade.GetDiscount(60));
Console.WriteLine(discountFacade.GetDiscount(110));