/// <summary> /// Deserializes an <see cref="CoreOptions" /> instance from a file in the file system. /// </summary> /// <param name="filePath"> /// The path to an options file from which a corresponding <see cref="CoreOptions" /> instance /// should be constructed. /// </param> /// <returns> /// An <see cref="CoreOptions" /> instance that represents to configuration contained in the file specified by /// <paramref name="filePath" />. /// If there were errors upon deserialization, <see langword="null" /> is returned. /// </returns> public static async Task <CoreOptions> LoadAsync(string filePath) { return(await JsonOptionsManager.DeserializeAsync <CoreOptions> (filePath)); }
/// <summary> /// Serializes an <see cref="CoreOptions" /> instance to a file in the file system. /// </summary> /// <param name="options">The <see cref="CoreOptions" /> instance to serialize.</param> /// <param name="filePath">The path to which an options file should be persisted.</param> public static async Task SaveAsync(CoreOptions options, string filePath) { await JsonOptionsManager.SerializeAsync(options, filePath); }