I have a Web-API developed with .Net Core.It has few end points ( GET / POST ). The requirement is to move that to AWS API-Gateway. That Web-API is built using layered architecture, it has a business layer that talks to Db layer that got some entity framework repositories ( backend database Postgres). Now i have re-created my solution as a AWS Serverless solution ( using one of the template projects that comes with AWS Toolkit for visual studio).
The question is how to make my web api methods AWS API Gatway enabled ? I tried publishing my web-api to AWS as it is but its creating a blank api in api gateway ( Visual studio says successfully published), that means for some reasons, Api-Gateway cannot recognize my endpoint within my solution, and i think the reason is i don't know how to configure them properly and make them AWS-API Gateway enabled ...
The second question is How the model binding will work in AWS API-GATEWAY. Should i use mapping template to implement model bindings or the built in .net core web api model binding will work and its sufficient ?
Following is an example Web API that is developed and needs to be deployed to AWS-API-Gateway
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
namespace TestApi
{
[Route("api/testapi")]
public class TestApiController : Controller
{
private ITestApiManager testApiManager;
public TestApiController(ITestApiManager testApiManager)
{
this.testApiManager = testApiManager;
}
// GET: api/testapi/data/D-001
[HttpGet]
[Route("data/{param}")]
public IActionResult SomeMethod(string param)
{
// This method access busines layer which calls data access layer to get the data from postgress database using entity framework
}
// There are some more similar GET and POST methods in this api as well
}
}