public static T Deserialize <T>(string fullFileName) { using var streamReader = StreamFactory.CreateStreamReader(fullFileName); using var jsonReader = JsonFactory.CreateJsonReader(streamReader); var jsonSerializer = JsonFactory.CreateJsonSerializer(); return(jsonSerializer.Deserialize <T>(jsonReader)); }
private string ReadFromWeb(string requestUri) { WebCommunicator.SetSecurityProtocol(); var request = WebCommunicator.CreateWebRequest(requestUri); WebCommunicator.InitializeWebRequest(request); using var response = WebCommunicator.GetWebResponse(request); using var dataStream = WebCommunicator.GetResponseStream(response); using var reader = StreamFactory.CreateStreamReader(dataStream); var responseFromServer = reader.ReadToEnd(); return(responseFromServer); }