﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc;

namespace ActivatorWebSite
{
    public class RegularController : Controller
    {
        public void Index()
        {
            // This verifies that ModelState and Context are activated.
            if (ModelState.IsValid)
            {
                Context.Response.WriteAsync("Hello world").Wait();
            }
        }
    }
}
﻿// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc;

namespace ActivatorWebSite
{
    public class RegularController : Controller
    {
        public async Task<EmptyResult> Index()
        {
            // This verifies that ModelState and Context are activated.
            if (ModelState.IsValid)
            {
                await Context.Response.WriteAsync("Hello world");
            }

            return new EmptyResult();
        }
    }
}
Fix an inadvertent 204 in activator tests
Fix an inadvertent 204 in activator tests

On a web server, this test ends up giving back a 204 because of the MVC
behavior when an action is declared to return void. The fix is to use
EmptyResult.
