Skip to content

Instantly share code, notes, and snippets.

View jorgelevy's full-sized avatar

Jorge Levy jorgelevy

View GitHub Profile
@jorgelevy
jorgelevy / profiles.json
Last active October 18, 2019 19:59
Windows Terminal profile json
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"profiles": [
{
// Make changes here to the Visual Studio Terminal profile
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6102}",
@Html.TextBoxFor(m => m[i].LastName, new { @class="form-control" })
public class Person
{
public int id { get; set; }
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Display(Name = "Last Name")]
public string LastName { get; set; }
@model List<ModelListBinding.Models.Person>
<form asp-action="Save" method="post" role="form">
<table>
<thead>
<tr>
<th><label asp-for="@Model[0].FirstName" class="control-label"></label></th>
<th><label asp-for="@Model[0].LastName" class="control-label"></label></th>
<th><label asp-for="@Model[0].Birthday" class="control-label"></label></th>
<th><label asp-for="@Model[0].IsActive" class="control-label"></label></th>
[HttpPost]
public IActionResult Save(List<Person> model)
{
//Manipular datos
return View(model);
}
@jorgelevy
jorgelevy / ModelListBinding.HomeController.cs
Last active October 4, 2019 06:09
Model List Binding - Controller code
public IActionResult Index()
{
List<Person> model = new List<Person>()
{
new Person() { id = 1, FirstName = "Jorge", LastName = "Levy", Birthday = new DateTime(1977, 3, 10), IsActive = true },
new Person() { id = 1, FirstName = "Maria", LastName = "Gutierrez", Birthday = new DateTime(1977, 1, 1), IsActive = true },
new Person() { id = 1, FirstName = "Samanta", LastName = "Lopez", Birthday = new DateTime(1980, 1, 1), IsActive = false },
new Person() { id = 1, FirstName = "Pedro", LastName = "Paramo", Birthday = new DateTime(1998, 12, 24), IsActive = false },
};
public class HomeController : BaseController
{
public IActionResult Index()
{
return View("Hola Mundo!!!");
}
}