SerializeHelper Deserialize Method MVC+ (Model-Facade-View-Controller) Framework for ASP.NET
De-serializes the resource into an Object.

Namespace: NovaDimension.Component
Assembly: NovaDimension.Component (in NovaDimension.Component.dll) Version: 4.0.209.0 (4.0.0209.0)
Syntax

public static Object Deserialize(
	string pPath,
	string pFilename
)

Return Value

Type: Object
Object that contains de-serialized resource
Exceptions

Examples

This sample shows how to use the Deserialize(String, String) static method.
using system;
using NovaDimension.Component;

/* Sample yaml file: myresource.yaml
%YAML 1.2
---
!YourNamespace.MyResource
Entity: 
  Attribute1: value1
  Attribute2: value2
  Attribute3: value3
... */ 

public sealed class MyResource
{
    private MyEntity entity;
    public MyEntity Entity { get { return entity; } }

    public MyResource()
    {
        entity = new MyEntity();
    }
}

public sealed class MyEntity
{
    public String Attribute1;
    public String Attribute2;
    public String Attribute3;
}

class TestClass()
{
    static int Main()
    {
        try
        {
            string pPath = System.AppDomain.CurrentDomain.BaseDirectory;
            string pFilename = "myresource.yaml";
            MyResource resource = (MyResource)SerializeHelper.Deserialize(pPath, pFilename);
        }
        catch (ExceptionEx<SerializeHelperException> ex)
        {
            Console.WriteLine(ex.Message);
        }
    }
}
See Also