Skip to content

Instantly share code, notes, and snippets.

@thehoneymad
Last active February 5, 2017 10:27
Show Gist options
  • Select an option

  • Save thehoneymad/c58a7c521291747ea673f9ae62a6a240 to your computer and use it in GitHub Desktop.

Select an option

Save thehoneymad/c58a7c521291747ea673f9ae62a6a240 to your computer and use it in GitHub Desktop.
Testing out .net core routing
namespace RocheClinicalTrial.Controllers
{
[AllowAnonymous]
[Route("api/[controller]")]
public class RocheClinicalTrialController : Controller
{
// GET: api/values
[HttpGet]
public JsonResult Get()
{
var repo = new Repository.Repository();
var data = repo.GetData();
return Json(data);
}
[HttpGet("{searchCriteria}")]
public string Get(string searchCriteria)
{
System.Console.WriteLine(searchCriteria);
return "value";
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment