private async void Button_Clicked(object sender, EventArgs e) { if (!activityIndicator.IsRunning) { var command = new CreateOrUpdatePositionCommand() { ZoneId = zone.Id, Name = name.Text }; try { activityIndicator.IsRunning = true; await positionsService.CreatePosition(command); await localeProvider.RefreshLocale(); activityIndicator.IsRunning = false; await Navigation.PopAsync(); } catch (Exception ex) { await DisplayAlert(AppResources.Error, ex.Message, "OK"); activityIndicator.IsRunning = false; } finally { activityIndicator.IsRunning = false; } } }
public async Task <ActionResult <Position> > UpdatePosition( [FromServices] IPositionService positionService, [FromRoute] int positionId, [FromBody] CreateOrUpdatePositionCommand command) { return(await positionService.UpdatePosition(positionId, command)); }
public Task <Position> UpdatePosition(int positionId, CreateOrUpdatePositionCommand command) { throw new NotImplementedException(); }
public async Task <Position> CreatePosition(CreateOrUpdatePositionCommand command) { return(await client.Post <Position>(positionsController, command)); }
public async Task <ActionResult <Position> > CreatePosition( [FromServices] IPositionService positionService, [FromBody] CreateOrUpdatePositionCommand command) { return(await positionService.CreatePosition(command)); }