forked from ddrilling/AsbCloudServer
HelpPageRepository. Допереименовал urlPage ->key
This commit is contained in:
parent
0aa8976526
commit
64de85361a
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user