JsonHelperSerializeT(T, String, JsonSerializerOptions) Method
Writes a Json file of the provided object type.
Namespace: Common.Core.ClassesAssembly: Common.Core (in Common.Core.dll) Version: 2.1.5
public static bool Serialize<T>(
T obj,
string fileName,
JsonSerializerOptions? options = null
)
where T : class
- obj T
- Object to save.
- fileName String
- Json file name.
- options JsonSerializerOptions (Optional)
- Optional Json serializer options.
- T
- Generic class or interface.
Boolean if the object was saved.
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. |
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. |