public Task <int> Execute(ScoreOptions options) { _kernel.Bind <ScgOptionsRepository>().ToSelf().InSingletonScope(); _kernel.Bind <ScgOptions>().ToMethod(p => _kernel.Get <ScgOptionsRepository>().Options); _kernel.Bind <FileRepository>().ToSelf().InSingletonScope().WithConstructorArgument("game", options.Game); _kernel.Bind <ScoreWorkflow>().ToSelf().InSingletonScope(); return(_kernel.Get <ScoreWorkflow>().Run(options)); }
public Task <int> Run(ScoreOptions options) { return(options.Operation switch { "add" => AddScore(options), "remove" => RemoveScore(), "list" => ListScores(), _ => throw new InvalidOperationException("The specified operation is not supported.") });
public static Task <int> Add(ScoreOptions options) { var bootstrapper = new Bootstrapper(); return(bootstrapper.Execute(options)); }