Class JsonFile
Inheritance
System.Object
JsonFile
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: WebApplication.Utils
Assembly: WebApplication.dll
Syntax
public static class JsonFile
Methods
| Improve this Doc View SourceMakeRelativePath(String, String)
Creates a relative path from one file or folder to another.
Declaration
public static string MakeRelativePath(string fromPath, string toPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | fromPath | Contains the directory that defines the start of the relative path. |
System.String | toPath | Contains the path that defines the endpoint of the relative path. |
Returns
Type | Description |
---|---|
System.String | The relative path from the start directory to the end path or |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | |
System.UriFormatException | |
System.InvalidOperationException |
Read<T>(String)
Declaration
public static T Read<T>(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
Write<T>(String, T, Formatting)
Declaration
public static void Write<T>(string path, T data, Formatting formatting = Formatting.Indented)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | |
T | data | |
Newtonsoft.Json.Formatting | formatting |
Type Parameters
Name | Description |
---|---|
T |