AspNet.Mvc.TypedRouting.Test.LinkGeneration.MyTestController.RedirectToActionOtherController C# (CSharp) Method

RedirectToActionOtherController() public method

public RedirectToActionOtherController ( ) : IActionResult
return IActionResult
        public IActionResult RedirectToActionOtherController()
        {
            return this.RedirectToAction<OtherController>(c => c.Action());
        }

Usage Example

        public void RedirectToAction_OtherController_ResolvesCorrectly()
        {
            // Arrange
            var controller = new MyTestController();

            // Act
            var result = controller.RedirectToActionOtherController() as RedirectToActionResult;

            // Assert
            Assert.NotNull(result);
            Assert.Null(result.RouteValues);
            Assert.Equal("Other", result.ControllerName);
            Assert.Equal("Action", result.ActionName);
            Assert.Equal(false, result.Permanent);
        }
All Usage Examples Of AspNet.Mvc.TypedRouting.Test.LinkGeneration.MyTestController::RedirectToActionOtherController