You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Common/Common/Security/Membership/MembershipService.cs

46 lines
1.3 KiB

2 years ago
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);
}
}