初始提交
This commit is contained in:
25
Services/Hncore.Pass.Vpn/Service/ArticleService.cs
Normal file
25
Services/Hncore.Pass.Vpn/Service/ArticleService.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Hncore.Infrastructure.Service;
|
||||
using Hncore.Pass.Vpn.Domain;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Hncore.Pass.Vpn.Service
|
||||
{
|
||||
public partial class ArticleService : ServiceBase<ArticleEntity>, IFindService
|
||||
{
|
||||
CourseContext m_DbContext;
|
||||
public ArticleService(CourseContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
|
||||
{
|
||||
m_DbContext = dbContext;
|
||||
}
|
||||
|
||||
public async Task<List<ArticleEntity>> GetTop(int top, ArticleCatalog catalog)
|
||||
{
|
||||
return await this.Query(m => m.CatalogId == catalog).Take(top).ToListAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user