|
|
|
|
using System.Collections.Immutable;
|
|
|
|
|
using Connected.Security;
|
|
|
|
|
using Connected.Security.Membership;
|
|
|
|
|
using Connected.ServiceModel;
|
|
|
|
|
using Connected.Services;
|
|
|
|
|
using Connected.Services.Annotations;
|
|
|
|
|
|
|
|
|
|
namespace Common.Security.Membership;
|
|
|
|
|
|
|
|
|
|
internal class MembershipService : EntityService<int>, IMembershipService
|
|
|
|
|
{
|
|
|
|
|
public MembershipService(IContext context) : base(context)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityDelete)]
|
|
|
|
|
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
|
|
|
{
|
|
|
|
|
await Invoke(GetOperation<DeleteMembership>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
|
|
|
public async Task<int> Insert(MembershipArgs args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<InsertMembership>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
|
|
|
public async Task<ImmutableList<IMembership>?> Query()
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<QueryMembership>(), Dto.Empty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
|
|
|
public async Task<ImmutableList<IMembership>?> Query(MembershipQueryArgs args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<SearchMembership>(), args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ServiceAuthorization(SecurityClaims.SecurityRead)]
|
|
|
|
|
public async Task<IMembership?> Select(PrimaryKeyArgs<int> args)
|
|
|
|
|
{
|
|
|
|
|
return await Invoke(GetOperation<SelectMembership>(), args);
|
|
|
|
|
}
|
|
|
|
|
}
|