using Luticate2.Utils.Controllers; using Luticate2.Utils.Dbo; using Luticate2.Utils.Dbo.OrderBy; using Microsoft.AspNetCore.Mvc; using Test.Utils.Dbo.PkGuid; using WebTest.Business; namespace WebTest.Controllers { public class PkGuidController : LuController { private readonly PkGuidBusiness _busines; public PkGuidController(PkGuidBusiness busines) { _busines = busines; } [HttpGet] [Route("[controller]/{id}")] public PkGuidDbo GetSingleById(string id) { return Handle(_busines.GetSingleById(id)); } [HttpGet] [Route("[controller]")] public LuPaginatedDbo GetMultiple(LuOrderByDbo orderBy, int page = 0, int perPage = int.MaxValue) { return Handle(_busines.GetMultiple(orderBy, page, perPage)); } [HttpPost] [Route("[controller]")] public PkGuidDbo Add([FromBody]PkGuidAddDbo data) { return Handle(_busines.AddDbo(data)); } [HttpPost] [Route("[controller]/{id}")] public PkGuidDbo Edit(string id, [FromBody]PkGuidAddDbo data) { return Handle(_busines.EditSingleByIdDbo(id, data)); } [HttpDelete] [Route("[controller]/{id}")] public PkGuidDbo Delete(string id) { return Handle(_busines.DeleteSingleByIdDbo(id)); } } }