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
var keywords = response.Select(obj => | |
new Tuple<int,string>(Convert.ToInt32(obj), obj.ToString()) | |
); |
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) Crear una branch nueva desde branch base | |
git checkout branchBase (para pararse en la branch deseada) | |
git checkout -b branchNueva (para crear la nueva a partir de la base) | |
2) Subir cambios al branch remoto | |
git add . (Agrega todos los cambios en el local) | |
*También, si no estás todavía muy cómodo con git podes usar el siguiente comando: | |
git add -p (este te permite ver lo que vas a agregar) | |
git commit -m "Mensaje” (genera un paquete con los cambios para enviar al remoto) | |
git push origin branchNombre (envia el contenido del commit al branch remoto) |
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
[Route("[controller]")] | |
public class RoutingController : Controller | |
{ | |
private readonly IUnitOfWork _unitOfWork; | |
private readonly IHtmlLocalizer<RoutingController> _localizer; | |
public RoutingController(IUnitOfWork unitOfWork, IHtmlLocalizer<RoutingController> localizer) | |
{ | |
this._unitOfWork = unitOfWork; | |
this._localizer = localizer; |
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 |
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
@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
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
{ | |
"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
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
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; |