17 lines
563 B
C#
17 lines
563 B
C#
using Application.Interfaces.Services;
|
|
using Domain.Entities;
|
|
using HotChocolate.Subscriptions;
|
|
|
|
namespace GraphQLTEST.GraphQL.Mutations;
|
|
|
|
[ExtendObjectType(nameof(MutationType))]
|
|
public class KillMutations
|
|
{
|
|
public async Task<Kill> RemoveKill(int id, [Service] IKillService service, [Service] ITopicEventSender eventSender, CancellationToken cancellationToken)
|
|
{
|
|
var kill = service.GetKillById(id);
|
|
service.RemoveKill(kill);
|
|
await eventSender.SendAsync(nameof(RemoveKill), kill, cancellationToken);
|
|
return kill;
|
|
}
|
|
} |