コード例 #1
0
        public static async Task UpdateCountryName(CountryId id, string name)
        {
            var connectionString  = ConnectivityService.GetConnectionString("TEMP");
            var context           = new SplurgeStopDbContext(connectionString);
            var repository        = new CountryRepository(context);
            var unitOfWork        = new EfCoreUnitOfWork(context);
            var service           = new CountryService(repository, unitOfWork);
            var countryController = new CountryController(service);

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

            await countryController.Put(updateCommand);
        }
コード例 #2
0
 public async Task <IActionResult> Put(Commands.SetCountryName request)
 => await RequestHandler.HandleCommand(request, _service.Handle);