Created
November 8, 2018 02:19
-
-
Save MarioCares/e24562270e57b8ac788226860741c5bc to your computer and use it in GitHub Desktop.
Respuesta formato JSON desde un controller
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 JsonResult ObtenerUsuario() | |
{ | |
var usuario = new Usuario { NombreUsuario = "MarioCares", Edad = 28, | |
Email = "[email protected]", Contrasegna = "123456"}; | |
var usuario2 = new Usuario(); | |
usuario2.NombreUsuario = "Juanito"; | |
usuario2.Contrasegna = "JuanitoRulz"; | |
usuario2.Email = "[email protected]"; | |
usuario2.Edad = 50; | |
List<Usuario> usuarios = new List<Usuario>(); | |
usuarios.Add(usuario); | |
usuarios.Add(usuario2); | |
return new JsonResult(usuarios); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment