Exemplo n.º 1
0
        public async Task <AddCommandPayload> AddCommandAsync(
            AddCommandInput input,
            [ScopedService] AppDbContext context,
            [Service] ITopicEventSender eventSender,
            CancellationToken token)
        {
            var command = new CommanderGQL.Models.Command {
                HowTo       = input.HowTo,
                CommandLine = input.CommandLine,
                PlatformId  = input.PlatformId
            };

            context.Commands.Add(command);
            await context.SaveChangesAsync();


            return(new AddCommandPayload(command));
        }
Exemplo n.º 2
0
 public Platform GetPlatform(CommanderGQL.Models.Command command, [ScopedService] AppDbContext context)
 {
     return(context.Platforms.FirstOrDefault(p => p.Id == command.PlatformId));
 }