initial upload
This commit is contained in:
parent
a0aa9cc28e
commit
f857f43df4
553 changed files with 46169 additions and 13 deletions
36
src/Core/Insight.Infrastructure/Services/HostService.cs
Normal file
36
src/Core/Insight.Infrastructure/Services/HostService.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using Insight.Infrastructure.Entities;
|
||||
using Insight.Infrastructure.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MongoDB.Driver;
|
||||
|
||||
namespace Insight.Infrastructure.Services
|
||||
{
|
||||
public class HostService
|
||||
{
|
||||
private readonly IMongoDatabase _database;
|
||||
private readonly ILogger<HostService> _logger;
|
||||
|
||||
public HostService(IMongoDatabase database, ILogger<HostService> logger)
|
||||
{
|
||||
_database = database;
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Task<PagedList<HostEntity>> GetAsync(
|
||||
FilterDefinition<HostEntity>? filter = null,
|
||||
SortDefinition<HostEntity>? sort = null,
|
||||
int offset = 0,
|
||||
int limit = 10,
|
||||
CancellationToken cancellationToken = default) => _database.Host().GetPagedAsync(filter, sort, offset, limit, cancellationToken);
|
||||
|
||||
public Task<PagedList<HostEntity>> GetAsync(
|
||||
HttpRequest request,
|
||||
HttpResponse response,
|
||||
FilterDefinition<HostEntity>? filter = null,
|
||||
SortDefinition<HostEntity>? sort = null,
|
||||
int offset = 0,
|
||||
int limit = 10,
|
||||
CancellationToken cancellationToken = default) => _database.Host().GetPagedAsync(request, response, filter, sort, offset, limit, cancellationToken);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue