Add project files.

This commit is contained in:
2023-10-27 19:00:41 +07:00
parent 54a23f5c2c
commit 3949c3c62a
27 changed files with 1238 additions and 0 deletions

View File

@ -0,0 +1,32 @@
using APITemplate.Models;
using APITemplate.Services;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace APITemplate.Controllers
{
public class ExampleController : Controller
{
private ExampleService _svc;
public ExampleController(ExampleService svc)
{
_svc = svc;
}
// POST: ExampleController/Create
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create(Example e)
{
try
{
_svc.Insert(e);
return Created("",e);
}
catch
{
throw;
}
}
}
}