Small tweaks.
This commit is contained in:
parent
307d2ea198
commit
e87e819b14
|
|
@ -23,7 +23,11 @@ namespace Microsoft.AspNet.Mvc
|
||||||
|
|
||||||
public IActionResult Json(object value)
|
public IActionResult Json(object value)
|
||||||
{
|
{
|
||||||
// TODO: Make this work at some point
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public IActionResult View()
|
||||||
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
throw new InvalidOperationException(String.Format("Couldn't find controller '{0}'.", _descriptor.ControllerName));
|
throw new InvalidOperationException(String.Format("Couldn't find controller '{0}'.", _descriptor.ControllerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
Initialize(controller, _requestContext);
|
Initialize(controller);
|
||||||
|
|
||||||
var method = controller.GetType().GetMethod(_descriptor.ActionName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
|
var method = controller.GetType().GetMethod(_descriptor.ActionName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
|
||||||
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
return actionResult.ExecuteResultAsync(_requestContext);
|
return actionResult.ExecuteResultAsync(_requestContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Initialize(object controller, RequestContext requestContext)
|
private void Initialize(object controller)
|
||||||
{
|
{
|
||||||
var controllerType = controller.GetType();
|
var controllerType = controller.GetType();
|
||||||
|
|
||||||
|
|
@ -62,11 +62,11 @@ namespace Microsoft.AspNet.Mvc
|
||||||
{
|
{
|
||||||
if (prop.PropertyType == typeof(IOwinContext))
|
if (prop.PropertyType == typeof(IOwinContext))
|
||||||
{
|
{
|
||||||
prop.SetValue(controller, requestContext.HttpContext);
|
prop.SetValue(controller, _requestContext.HttpContext);
|
||||||
}
|
}
|
||||||
else if (prop.PropertyType == typeof(IDictionary<string, object>))
|
else if (prop.PropertyType == typeof(IDictionary<string, object>))
|
||||||
{
|
{
|
||||||
prop.SetValue(controller, requestContext.HttpContext.Environment);
|
prop.SetValue(controller, _requestContext.HttpContext.Environment);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,6 @@ namespace Microsoft.AspNet.Mvc
|
||||||
IActionResult Content(string value);
|
IActionResult Content(string value);
|
||||||
IActionResult Content(string value, string contentType);
|
IActionResult Content(string value, string contentType);
|
||||||
IActionResult Json(object value);
|
IActionResult Json(object value);
|
||||||
|
IActionResult View();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,5 +36,10 @@ namespace MvcSample
|
||||||
|
|
||||||
return responseMessage;
|
return responseMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IActionResult MyView()
|
||||||
|
{
|
||||||
|
return Result.View();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue