Connected.Common/Common/Net/EndpointService.cs
2022-12-07 14:05:43 +01:00

28 lines
709 B
C#

using System.Collections.Immutable;
using Connected.Net;
using Connected.Net.Endpoints;
using Connected.ServiceModel;
using Connected.Services;
using Connected.Services.Annotations;
namespace Common.Net;
internal sealed class EndpointService : EntityService<int>, IEndpointService
{
public EndpointService(IContext context) : base(context)
{
}
[ServiceAuthorization(NetClaims.NetDiscovery)]
public async Task<ImmutableList<IEndpoint>?> Query()
{
return await Invoke(GetOperation<QueryEndpoints>(), Dto.Empty);
}
[ServiceAuthorization(NetClaims.NetDiscovery)]
public async Task<IEndpoint?> Select(PrimaryKeyArgs<int> args)
{
return await Invoke(GetOperation<SelectEndpoint>(), args);
}
}