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)); }
public Platform GetPlatform(CommanderGQL.Models.Command command, [ScopedService] AppDbContext context) { return(context.Platforms.FirstOrDefault(p => p.Id == command.PlatformId)); }