I got the following class:
public MealService( IFoodRepository foodRepository,
IOrderRepository orderRepository,
IDishListRepository dishListRepository)
{
_inputValidator = inputValidator;
_foodRepository = foodRepository;
_orderRepository = orderRepository;
_dishListRepository = dishListRepository;
}
... then, some code here
at the end of the process, I do:
private async Task<Order> CreateOrderAsync(int dayTime, List<Item> items)
{
Order order = new Order();
DishList dl;
Food food;
foreach (Item it in items)
{
dl = await _dishListRepository.GetAsync(dayTime, it.DishType);
food = await _foodRepository.GetAsync(dl.FoodId);
it.Food = food.Name;
order.Items.Add(it);
}
await _orderRepository.AddAsync(order);
return order;
}
Am I going against the Single responsability principle (the 'S' in SOLID)? I mean, could injecting too many interfaces into a class mean that the class has too many responsibilities?
Thanks in advance.