Skip to content

Instantly share code, notes, and snippets.

@jeffhollan
Created May 29, 2019 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffhollan/a28b847b839a02f750b26b29ca20fba3 to your computer and use it in GitHub Desktop.
Save jeffhollan/a28b847b839a02f750b26b29ca20fba3 to your computer and use it in GitHub Desktop.
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
namespace functions_csharp_entityframeworkcore
{
public class HttpTrigger
{
private readonly BloggingContext _context;
public HttpTrigger(BloggingContext context)
{
_context = context;
}
[FunctionName("GetPosts")]
public async Task<IActionResult> Get(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "posts")] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
// Code that returns posts - you can see this code by going
// to the full sample linked at the bottom
return new OkResult();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment