Exemplo n.º 1
0
            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));
            }
Exemplo n.º 2
0
 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.")
     });
Exemplo n.º 3
0
        public static Task <int> Add(ScoreOptions options)
        {
            var bootstrapper = new Bootstrapper();

            return(bootstrapper.Execute(options));
        }