JsonHelperDeserializeFileT Method
Reads a Json file and populates an object.
Namespace: Common.Core.ClassesAssembly: Common.Core (in Common.Core.dll) Version: 2.1.5
public static T DeserializeFile<T>(
string fileName,
JsonSerializerOptions? options = null
)
where T : class
- fileName String
- Json file name.
- options JsonSerializerOptions (Optional)
- Optional Json serializer options.
- T
- Generic class or interface.
T is returned if the object could not be populated.
ArgumentException | Thrown when one of the arguments provided to a method is not valid. |
IOException | Thrown when an I/O error occurs. |
NotSupportedException | Thrown when an invoked method is not supported, or when there
is an attempt to read, seek, or write to a stream that does not support the invoked functionality. |
OutOfMemoryException | Thrown when there is not enough memory to continue. |
SecurityException | Thrown when a security error is detected. |
UnauthorizedAccessException | Thrown when the operating system denies access because of an I/O error or a specific type of security error. |