Call WCF RIA Methods

Code snippet to call WCF RIA Methods

private void LoadExplorer(string path)
{
    Web.Services.ExplorerContext context = new Web.Services.ExplorerContext();
    EntityQuery query = context.EnumerateDirectoryQuery(path);
    Action<LoadOperation> completeProcessing = delegate(LoadOperation loadOp)
    {
        if (!loadOp.HasError)
        {
            // Perform actions required after request complete
            foreach (DirectoryInfoItem dirInfo in loadOp.Entities)
            {

            }
        }
        else
        {
            LogAndNotify(loadOp.Error);
            loadOp.MarkErrorAsHandled();
        }
    };
    LoadOperation loadOperation = context.Load(query, completeProcessing, null);
}

private void LogAndNotify(Exception error)
{
    ErrorWindow.CreateNew(error);
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s