Skip to content

Instantly share code, notes, and snippets.

Eduardo Miranda eduardomps

Block or report user

Report or block eduardomps

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
eduardomps / HomeController.cs
Created Jul 31, 2016
ASP.NET Core MVC Localization/ViewLocalization using a shared .resx file
View HomeController.cs
// src/Project/Controllers/HomeController.cs
// using the HomeController as an example
// you don't need it if you only want to localize strings in your views
public IStringLocalizer<SharedResource> _localizer;
// here comes the magic: the DI will inject your localizer
// created by the factory you set up at Startup.ConfigureServices()
public HomeController(IStringLocalizer<SharedResource> localizer)
You can’t perform that action at this time.