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
{ | |
"Logging": { | |
"IncludeScopes": false, | |
"LogLevel": { | |
"Default": "Debug", | |
"System": "Information", | |
"Microsoft": "Information" | |
} | |
}, | |
"ConnectionString": "User ID=your_user;Password=your_password;Host=your_host;Port=5432;Database=dbname;Pooling=true;Timeout=1024;CommandTimeout=1024;" |
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 Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Localization; | |
using Microsoft.EntityFrameworkCore; | |
using NetCoreBootstrap.Models.Database; | |
namespace NetCoreBootstrap.Controllers | |
{ | |
public class HomeController : Controller | |
{ | |
private readonly DbContextOptions<DataBaseContext> _options; |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddJsonLocalization(options => options.ResourcesPath = "Resources"); | |
services.AddMvc().AddViewLocalization(); | |
CultureInfo.CurrentCulture = new CultureInfo("en-US"); | |
} |
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
{ | |
"DescriptionPage": "Your application description page.", | |
"ContactPage": "Your contact page.", | |
"HomePage": "Home Page" | |
} |
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 |
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 Microsoft.AspNetCore.Mvc.Localization | |
@using System.Globalization; | |
@inject IViewLocalizer Localizer | |
@{ | |
ViewData["Title"] = Localizer["HomePage"]; | |
} |
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
// src/Repositories/Database/DataBaseContext.cs | |
#region Using | |
using Microsoft.EntityFrameworkCore; | |
using MvcMovie.Models; | |
#endregion | |
namespace MvcMovie.Repositories.Database | |
{ | |
public class DataBaseContext : DbContext |
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
// ExampleApp/src/Models/Views/UserViewModel.cs | |
namespace ExampleApp.Models.Views | |
{ | |
public class UserViewModel | |
{ | |
public string Username { get; set; } | |
public string Name { get; set; } | |
public string Email { get; set; } | |
public int DNI { get; set; } |
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
public class ExampleController : Controller | |
{ | |
private readonly IUnitOfWork _unitOfWork | |
public ExampleController(IUnitOfWork unitOfWork) | |
{ | |
this._unitOfWork = unitOfWork; | |
} | |
public IUnitOfWork UnitOfWork |
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
1) Abrir Terminal | |
2) Modificar contraseña de usuario ‘postgres’: | |
sudo -u postgres psql | |
alter user postgres with password 'new_password' | |
3) Abrir el archivo localizado en /etc/postgresql/<version_number>/main/pg_hba.conf, y modificar para que quede de la siguiente manera: | |
# Database administrative login by Unix domain socket | |
local all postgres md5 |
OlderNewer