blob: 43ee5a0cb24795f1f8df7e225b7177905ee498cb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.Globalization;
using System.Web.Mvc.Properties;
namespace System.Web.Mvc.Async
{
public abstract class AsyncActionDescriptor : ActionDescriptor
{
public abstract IAsyncResult BeginExecute(ControllerContext controllerContext, IDictionary<string, object> parameters, AsyncCallback callback, object state);
public abstract object EndExecute(IAsyncResult asyncResult);
public override object Execute(ControllerContext controllerContext, IDictionary<string, object> parameters)
{
string errorMessage = String.Format(CultureInfo.CurrentCulture, MvcResources.AsyncActionDescriptor_CannotExecuteSynchronously,
ActionName);
throw new InvalidOperationException(errorMessage);
}
internal static AsyncManager GetAsyncManager(ControllerBase controller)
{
IAsyncManagerContainer helperContainer = controller as IAsyncManagerContainer;
if (helperContainer == null)
{
throw Error.AsyncCommon_ControllerMustImplementIAsyncManagerContainer(controller.GetType());
}
return helperContainer.AsyncManager;
}
}
}
|