Show / Hide Table of Contents

    Controller: DataStoreExampleController.cs

    using Appeon.ApiDoc.Models;
    using DWNet.Data;
    using Microsoft.AspNetCore.Mvc;
    using SnapObjects.Data;
    
    namespace Appeon.ApiDoc.DataStoreExamples
    {
    
        [Route("examples/DataStore/[action]")]
        public class DataStoreExampleController : Controller
        {
            private readonly SchoolContext _dataContext;
    
            public DataStoreExampleController(SchoolContext dataContext)
            {
                // Sets the data context.
                _dataContext = dataContext;
            }
    
            [HttpPost]
            public string Example(IDataUnpacker dataUnpacker)
            {
                // Uses IDataUnpack to receive JSON data from the PB client app.
                var student =
                    dataUnpacker.GetModelEntries<D_Person>("student");
    
                var example = new DataStoreExample(_dataContext);
    
                example.Example4(student);
    
                return "SUCCESS";
            }
        }
    }
    

    Refer To

    JSON File: DataStoreExample

    Back to top Generated by Appeon