public static async Task UpdateCityName(CityId id, string name)
        {
            var connectionString = ConnectivityService.GetConnectionString("TEMP");
            var context          = new SplurgeStopDbContext(connectionString);
            var repository       = new CityRepository(context);
            var unitOfWork       = new EfCoreUnitOfWork(context);
            var service          = new CityService(repository, unitOfWork);
            var cityController   = new CityController(service);

            var updateCommand = new Commands.SetCityName {
                Id = id, Name = name
            };

            await cityController.Put(updateCommand);
        }
Exemple #2
0
 public async Task <IActionResult> Put(Commands.SetCityName request)
 => await RequestHandler.HandleCommand(request, service.Handle);