Controller: GetRawExampleController.cs
using Microsoft.AspNetCore.Mvc;
using Appeon.ApiDoc.Models.School;
using SnapObjects.Data;
using System.Linq;
namespace Appeon.ApiDoc.IDataUnpackerExamples.Controllers
{
[Route("examples/IDataUnpacker/GetRaw/[action]")]
public class GetRawExampleController : Controller
{
SchoolContext _dataContext;
public GetRawExampleController(SchoolContext dataContext)
{
// Sets the data context.
_dataContext = dataContext;
}
[HttpPost]
public string Example(IDataUnpacker dataUnpacker)
{
// Uses IDataUnpack to receive JSON data from the client app.
var example = new GetRawExample(_dataContext);
example.Example(dataUnpacker);
return "SUCCESS";
}
}
}
Refer To
JSON File: GetRawExample