Exemple #1
0
        protected T InvokeServiceCheckInternetConnection <T>(Func <T> serviceMethod)
        {
            var isInternetConnection = ConnectivityService.IsInternetConnection();

            if (!isInternetConnection)
            {
                throw new NoInternetConnectionException($"Cannot request to {nameof(serviceMethod)}");
            }

            return(serviceMethod.Invoke());
        }