@echo using System;
@echo using System.Threading.Tasks;
@echo using Microsoft.AspNetCore.Mvc;
@echo using Microsoft.AspNetCore.Http;
@echo using HRD.LDAPService.JWT;
@echo using HRD.WebApi.Controllers;
@echo using HRD.WebApi.Repositories;
@echo using DAL.Repositories;
@echo using DAL.Models.Entities;
@echo using DAL.Models.Filters;
@echo.
@echo namespace %2Server.Controllers
@echo {
@echo     [JWTAuthorize]
@echo     public class %1Controller : BaseController^<%1^>
@echo     {
@echo         public %1Controller(IBaseRepository^<%1^> repositoryBase) : base(repositoryBase)
@echo         {
@echo         }
@echo.
@echo         [HttpPost("%3Filter")]
@echo         public async Task^<IActionResult^> Get%1ListAsync([FromBody] %3Filter filter)
@echo         {
@echo             try
@echo             {
@echo                 var list = await ((%1Repository)EntityRepository).GetListByFilterAsync(filter);
@echo                 return new OkObjectResult(list);
@echo             }
@echo             catch (Exception ex)
@echo             {
@echo                 this.WriteLogException(ex);
@echo                 return StatusCode(StatusCodes.Status400BadRequest, $"Cann't get the filtered list of {typeof(%1).Name}");
@echo             }
@echo         }
@echo     }
@echo }
