This commit is contained in:
mmrbnjd
2024-04-03 14:36:33 +03:30
parent dd4969f504
commit 8e8bffa8a8
10 changed files with 109 additions and 85 deletions

View File

@@ -34,10 +34,23 @@ namespace Back.Services
Title = s.Title,
Date=s.Date,
ID=s.ID,
Photo=string.IsNullOrEmpty(s.Photo) ? "blog-grid-1.jpg" : s.Photo
Photo=string.IsNullOrEmpty(s.Photo) ? "blog-SampleTitle.jpg" : s.Photo
}).Paging(PageIndex, PageSize); ;
}
public async Task<BlogDtoFull?> GetBlogByID(int ID)
{
var result= await _repoBlog.Get(w => w.Status && w.ID==ID)
.Select(s => new BlogDtoFull
{
Title = s.Title,
Date = s.Date,
ID = s.ID,
Photo = string.IsNullOrEmpty(s.Photo) ? "blog-SampleTitle.jpg" : s.Photo,
Text=s.Text,
Time=s.Time
}).FirstOrDefaultAsync();
return result;
}
}
}