using EnablementDAL.CustomCode.ShowContentLink; using EnablementDAL.DTO; using EnablementDAL.Query.Show; using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; namespace EnablementDAL.Implementations; public class ShowContentLinkDAL : IShowContentLinkDAL { private readonly IQueryExecutor _qe; public ShowContentLinkDAL(IQueryExecutor qe) => _qe = qe; public async Task GetShowContentLinkAsync(int showContentLinkId, LoginDTO login, CancellationToken ct) => await _qe.QuerySingleAsync( login, ShowContentLinkQB.GET_SHOW_CONTENT_LINK, new { ShowContentLinkId = showContentLinkId, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false); public async Task> GetShowContentLinkListAsync( int showId, int stepId, int pageNo, int pageSize, LoginDTO login, CancellationToken ct) => await _qe.QueryAsync( login, ShowContentLinkQB.GET_SHOW_CONTENT_LINK_LIST, new { ShowId = showId, StepId = stepId, TenantId = login.ClientId, PageNo = pageNo, PageSize = pageSize }, cancellationToken: ct).ConfigureAwait(false); public async Task GetShowContentLinkListCountAsync(int showId, int stepId, LoginDTO login, CancellationToken ct) => await _qe.ExecuteScalarAsync( login, ShowContentLinkQB.GET_SHOW_CONTENT_LINK_LIST_COUNT, new { ShowId = showId, StepId = stepId, TenantId = login.ClientId }, cancellationToken: ct).ConfigureAwait(false); public async Task InsertShowContentLinkAsync(ShowContentLinkDTO dto, LoginDTO login, CancellationToken ct) => await _qe.ExecuteAsync( login, ShowContentLinkQB.INSERT_SHOW_CONTENT_LINK, dto, cancellationToken: ct).ConfigureAwait(false); public async Task UpdateShowContentLinkAsync(ShowContentLinkDTO dto, LoginDTO login, CancellationToken ct) => await _qe.ExecuteAsync( login, ShowContentLinkQB.UPDATE_SHOW_CONTENT_LINK, dto, cancellationToken: ct).ConfigureAwait(false); public async Task DeleteShowContentLinkAsync(int showContentLinkId, LoginDTO login, CancellationToken ct) => await _qe.ExecuteAsync( login, ShowContentLinkQB.DELETE_SHOW_CONTENT_LINK, new { ShowContentLinkId = showContentLinkId, TenantId = login.ClientId, ModifiedById = login.UserId }, cancellationToken: ct).ConfigureAwait(false); public async Task GetShowCmsChannelIdAsync(int showId, LoginDTO login, CancellationToken ct) => await _qe.ExecuteScalarAsync( login, ShowContentLinkQB.GET_SHOW_CMS_CHANNEL_ID, new { ShowId = showId }, cancellationToken: ct).ConfigureAwait(false); }