public void SetNation() { Belligerent.NationId = Int32.Parse(Belligerent.NationIdString); Belligerent.Nation = _nations.FirstOrDefault(n => n.NationId == Belligerent.NationId); EventParticipantDataService.Update(Belligerent.EventParticipantId, Belligerent); StateHasChanged(); }
private void DeleteAsset(int id) { Belligerent.Assets.Remove(Belligerent.Assets.FirstOrDefault(b => b.AssetId == id)); EventParticipantDataService.Update(Belligerent.EventParticipantId, Belligerent); AssetDataService.Delete(id); StateHasChanged(); }
public async void AddUnitAssetDialog_OnAssetAdded(Asset asset) { asset.EventParticipantId = Belligerent.EventParticipantId; var entry = await AssetDataService.Add(asset); Belligerent.Assets.Add(entry); await EventParticipantDataService.Update(Belligerent.EventParticipantId, Belligerent); StateHasChanged(); }
protected async void AddParticipant() { var newParticipant = await EventParticipantDataService.Add(new EventParticipant() { EventId = Event.EventId }); Event.Participants.Add(newParticipant); await EventDataService.Update(Event.EventId, Event); StateHasChanged(); }