...
This commit is contained in:
@@ -10,10 +10,12 @@ namespace Back.Services
|
||||
{
|
||||
private readonly IAsyncRepository<Pricing> _repoPricing;
|
||||
private readonly IAsyncRepository<Blog> _repoBlog;
|
||||
public ServBase(IAsyncRepository<Pricing> repoPricing, IAsyncRepository<Blog> repoBlog)
|
||||
private readonly IAsyncRepository<Question> _repoQuestion;
|
||||
public ServBase(IAsyncRepository<Pricing> repoPricing, IAsyncRepository<Blog> repoBlog, IAsyncRepository<Question> repoQuestion)
|
||||
{
|
||||
_repoPricing = repoPricing;
|
||||
_repoBlog = repoBlog;
|
||||
_repoQuestion = repoQuestion;
|
||||
}
|
||||
public async Task<List<BasePriceDto>> GetBasePrice()
|
||||
{
|
||||
@@ -37,6 +39,18 @@ namespace Back.Services
|
||||
Photo=string.IsNullOrEmpty(s.Photo) ? "blog-SampleTitle.jpg" : s.Photo
|
||||
}).Paging(PageIndex, PageSize); ;
|
||||
}
|
||||
public async Task<PagingDto<QuestionDto>> GetQuestion(int PageIndex, int PageSize)
|
||||
{
|
||||
return await _repoQuestion.Get(w => w.Status)
|
||||
.Include(inc=>inc.questionCategory).OrderByDescending(o => o.ID)
|
||||
.Select(s => new QuestionDto
|
||||
{
|
||||
Answer=s.Answer,
|
||||
Category=s.questionCategory.Title,
|
||||
Title=s.Title,
|
||||
ID = s.ID
|
||||
}).Paging(PageIndex, PageSize);
|
||||
}
|
||||
public async Task<BlogDtoFull?> GetBlogByID(int ID)
|
||||
{
|
||||
var result= await _repoBlog.Get(w => w.Status && w.ID==ID)
|
||||
|
Reference in New Issue
Block a user