Created
December 30, 2018 17:15
-
-
Save azaharafernandezguizan/c29695e47b7a4873c5d84768d7873666 to your computer and use it in GitHub Desktop.
Example of Web API Controller on NetCore
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.Linq; | |
using System.Threading.Tasks; | |
using MyDTOs; | |
using MyManager; | |
using Microsoft.AspNetCore.Mvc; | |
namespace MyApp.Controllers | |
{ | |
[Route("api/[controller]")] | |
public class InfoController : Controller | |
{ | |
public IInfoManager infoManager = new InfoManager(); | |
[HttpGet] | |
public String GetDefault() | |
{ | |
return "Bienvenido a la WebAPI de ejemplo"; | |
} | |
[HttpGet("getRecursos", Name = "GetRecursos")] | |
public List<RecursosInfo> GetRecursos() | |
{ | |
return infoManager.getRecursos(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment