using Microsoft.AspNetCore.Mvc;
namespace AspNetCoreInterview.Controllers
public static void Main(string[] args)
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
if (app.Environment.IsDevelopment())
app.UseHttpsRedirection();
public class InterviewController : ControllerBase
public InterviewController()
public IActionResult TwoSum([FromBody] int[] numbers, [FromQuery] int target)