HelpPageRepository. Допереименовал urlPage ->key

This commit is contained in:
ngfrolov 2023-07-18 16:45:11 +05:00
parent 0aa8976526
commit 64de85361a
Signed by untrusted user who does not match committer: ng.frolov
GPG Key ID: E99907A0357B29A7
2 changed files with 8 additions and 8 deletions

View File

@ -13,22 +13,22 @@ public interface IHelpPageRepository : ICrudRepository<HelpPageDto>
/// <summary>
/// Получение справки по url страницы и id категории
/// </summary>
/// <param name="urlPage"></param>
/// <param name="key"></param>
/// <param name="idCategory"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<HelpPageDto?> GetOrDefaultByUrlPageAndIdCategoryAsync(string urlPage,
Task<HelpPageDto?> GetOrDefaultByUrlPageAndIdCategoryAsync(string key,
int idCategory,
CancellationToken cancellationToken);
/// <summary>
/// Проверяет наличие справки для страницы
/// </summary>
/// <param name="urlPage"></param>
/// <param name="key"></param>
/// <param name="idCategory"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<bool> IsExistingAsync(string urlPage,
Task<bool> IsExistingAsync(string key,
int idCategory,
CancellationToken cancellationToken);
}

View File

@ -16,13 +16,13 @@ public class HelpPageRepository : CrudRepositoryBase<HelpPageDto, HelpPage>,
{
}
public async Task<HelpPageDto?> GetOrDefaultByUrlPageAndIdCategoryAsync(string urlPage,
public async Task<HelpPageDto?> GetOrDefaultByUrlPageAndIdCategoryAsync(string key,
int idCategory,
CancellationToken cancellationToken)
{
var helpPage = await dbSet.AsNoTracking()
.SingleOrDefaultAsync(x =>
x.UrlPage == urlPage &&
x.UrlPage == key &&
x.IdCategory == idCategory,
cancellationToken);
@ -32,8 +32,8 @@ public class HelpPageRepository : CrudRepositoryBase<HelpPageDto, HelpPage>,
return helpPage.Adapt<HelpPageDto>();
}
public Task<bool> IsExistingAsync(string urlPage, int idCategory, CancellationToken cancellationToken) =>
dbContext.HelpPages.AnyAsync(h => h.UrlPage == urlPage &&
public Task<bool> IsExistingAsync(string key, int idCategory, CancellationToken cancellationToken) =>
dbContext.HelpPages.AnyAsync(h => h.UrlPage == key &&
h.IdCategory == idCategory,
cancellationToken);
}