public ICommand GetCommand(CartOperationEnum cartOperationEnum) { switch (cartOperationEnum) { case CartOperationEnum.Create: return(new CreateCommand()); case CartOperationEnum.Delete: return(new DeleteCommand()); default: throw new ArgumentException($"{nameof(cartOperationEnum)} is invalid command"); } }
public void SetCommand(CartOperationEnum cartOperationEnum) { _command = _commandFactory.GetCommand(cartOperationEnum: cartOperationEnum); }