using EnablementBLL.Show; using EnablementSL.Parameters.Show; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; namespace EnablementSL.Endpoints.Show; public class DeleteShow : BaseEndpoint> { private readonly IShowBLL _bll; public DeleteShow(IShowBLL bll) => _bll = bll; public override void Configure() { Delete("/Enablement/DeleteShow"); AllowAnonymous(); } protected override string? GetCacheKey(GetShowParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( GetShowParameters req, LoginDTO login, CancellationToken ct) { try { var result = await _bll.DeleteShow(req.ShowId, login).ConfigureAwait(false); return await GB5Shared.ResponseStandard.Response.CreateSuccessResponse( result, GB5Shared.GB5Constant.Constant.CacheKeyLevel.NOT_REQUIRED, login); } catch (Exception ex) { return await GB5Shared.ResponseStandard.Response.CreateExceptionError( ex, GB5Shared.GB5Constant.Constant.CacheKeyLevel.NOT_REQUIRED, login, ex.Message, 500); } } }