using GB5Shared.DTO.Framework.Login; using GB5Shared.QueryExecutor; using KmsDAL.DTO.KmContent; using KmsDAL.Query.KmContent; namespace KmsDAL.CustomCode.KmContent { public class KmContentDAL : IKmContentDAL { private readonly IQueryExecutor _qe; public KmContentDAL(IQueryExecutor qe) => _qe = qe; public async Task SaveKmContent(KmContentDTO dto, LoginDTO login, CancellationToken ct) => await _qe.ExecuteAsync(login, KmContentQB.SAVE_KMCONTENT, dto, cancellationToken: ct); public async Task DeleteKmContentByArtifact(int artifactId, LoginDTO login, CancellationToken ct) => await _qe.ExecuteAsync(login, KmContentQB.DELETE_KMCONTENT_BY_ARTIFACT, new { ArtifactId = artifactId }, cancellationToken: ct); public async Task GetNextSlno(int artifactId, LoginDTO login, CancellationToken ct) => await _qe.ExecuteScalarAsync(login, KmContentQB.GET_NEXT_SLNO, new { ArtifactId = artifactId }, cancellationToken: ct); public async Task GetPrimaryContentByArtifact(int artifactId, LoginDTO login, CancellationToken ct) => await _qe.ExecuteScalarAsync(login, KmContentQB.GET_PRIMARY_CONTENT_BY_ARTIFACT, new { ArtifactId = artifactId }, cancellationToken: ct); } }