initial upload

This commit is contained in:
kkb 2023-09-21 18:58:32 +02:00
parent a0aa9cc28e
commit f857f43df4
553 changed files with 46169 additions and 13 deletions

View 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 AgentService
{
private readonly IMongoDatabase _database;
private readonly ILogger<AgentService> _logger;
public AgentService(IMongoDatabase database, ILogger<AgentService> logger)
{
_database = database;
_logger = logger;
}
public Task<PagedList<AgentEntity>> GetAsync(
FilterDefinition<AgentEntity>? filter = null,
SortDefinition<AgentEntity>? sort = null,
int offset = 0,
int limit = 10,
CancellationToken cancellationToken = default) => _database.Agent().GetPagedAsync(filter, sort, offset, limit, cancellationToken);
public Task<PagedList<AgentEntity>> GetAsync(
HttpRequest request,
HttpResponse response,
FilterDefinition<AgentEntity>? filter = null,
SortDefinition<AgentEntity>? sort = null,
int offset = 0,
int limit = 10,
CancellationToken cancellationToken = default) => _database.Agent().GetPagedAsync(request, response, filter, sort, offset, limit, cancellationToken);
}
}