Created
November 13, 2017 17:35
-
-
Save gzamudio/5fbf86f604b28bc63ddd4aa932cb9c6c to your computer and use it in GitHub Desktop.
Controller Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Localization; | |
using <yourNamespace>.Models; | |
namespace <yourNamespace>.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
private readonly IHtmlLocalizer<HomeController> _localizer; | |
public HomeController(IHtmlLocalizer<HomeController> localizer) | |
{ | |
this._localizer = localizer; | |
} | |
public IActionResult Contact() | |
{ | |
ViewData["Message"] = _localizer["ContactPage"]; | |
return View(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment