public async Task <IActionResult> Put([FromBody] SettingsModel model) { var updateSettingsCommand = new UpdateSettingsCommand { Setting = model.Map <SettingsModel, Setting>() }; await _commandProcessor.SendAsync(updateSettingsCommand); if (updateSettingsCommand.HasAdded) { return(Created(string.Empty, model)); } return(Ok(model)); }
public CommandResult UpdateSettings(UpdateSettingsCommand updateSettingsCommand, string settings) { string result = connection.Put(updateSettingsCommand, settings); return(Serializer.ToCommandResult(result)); }
public static async Task UpdateSettings(TestSessionClient session, CancellationToken cancellationToken) { var settings = TestSerializer.WriteSettings(session.App.Settings); var command = new UpdateSettingsCommand(); await command.Send(session, settings, cancellationToken); }