TopShelfCustomer/TopShelfCustomer/Services/SerializationHelper.cs
/// <summary>
/// JsonWrite:
///
/// Static method to write a file to the static filepath.
/// Takes the filename and json/string data as parameters
/// </summary>
/// <param name="filename"> the name of the file to write to (no extension)</param>
/// <param name="jsonData"> the JSON string to write </param>
/// <returns> bool indicating success </returns>


Static method to write a file to the static filepath.
Takes the filename and json/string data as parameters
Static method to write a file to the static filepath . Takes the filename and json / string data as parameters
public static bool JsonWrite ( string filename, string jsonData ) {
            try {
                var filepath = Path.Combine( FolderPath, filename + FileExtension );        
                File.WriteAllText( filepath, jsonData );        
                return true;
            } catch ( Exception e ) {
                Debug.WriteLine( e.Message );
                return false;
            }
        }
public static bool JsonWrite ( string filename , string jsonData ) { try { var filepath = Path . Combine ( FolderPath , filename + FileExtension ) ; File . WriteAllText ( filepath , jsonData ) ; return true ; } catch ( Exception e ) { Debug . WriteLine ( e . Message ) ; return false ; } }
JsonWrite:
JsonWrite :
//Create the file path //Write the passed string to the file
bool indicating success
bool indicating success
filename
string
the name of the file to write to (no extension)
the name of the file to write to ( no extension )
jsonData
string
the JSON string to write
the JSON string to write