Class EmbeddedResourceUtility
- Namespace
- Utilty
- Assembly
- DougWare.OobaboogaAPIHelper.dll
An abstract base class that provides methods for deserializing an object from an embedded resource
public class EmbeddedResourceUtility
- Inheritance
-
EmbeddedResourceUtility
- Inherited Members
Methods
GetObjectFromResource<T>(string)
Deserializes an object of type T from an embedded resource with the given name.
public static T GetObjectFromResource<T>(string resourceName)
Parameters
resourceNamestringThe name of the embedded resource containing the JSON data.
Returns
- T
An instance of type T deserialized from the embedded resource.
Type Parameters
TThe type of the object to deserialize.
Exceptions
- InvalidOperationException
Thrown when the resourceName is not found.
- JsonException
Thrown when deserialization fails.
GetStringFromResource(string)
Reads a string embedded resource with the given name.
public static string GetStringFromResource(string resourceName)
Parameters
resourceNamestringThe name of the embedded resource containing the JSON data.
Returns
- string
An string from the embedded resource.
Exceptions
- InvalidOperationException
Thrown when the resourceName is not found.