private async void LoadMembers() { var temp = (await GetAllMembers()).Payload.ToList(); if (Members.NotNull() && temp.Count != Members.Count) { Members = temp; MembersChanged?.Invoke(this, null); } }
public async Task CreateMember(MemberVm model) { var result = await Create(model.ToCreateMemberCommand()); if (result != null) { var updatedList = (await GetAllMembers()).Payload; if (updatedList != null) { members = updatedList; MembersChanged?.Invoke(this, null); return; } CreateMemberFailed?.Invoke(this, "The creation was successful, but we can no longer get an updated list of members from the server."); } CreateMemberFailed?.Invoke(this, "Unable to create record."); }
public async Task UpdateMember(MemberVm model) { var result = await Update(model.ToUpdateMemberCommand()); Console.WriteLine(JsonSerializer.Serialize(result)); if (result != null) { var updatedList = (await GetAllMembers()).Payload; if (updatedList != null) { members = updatedList; MembersChanged?.Invoke(this, null); return; } UpdateMemberFailed?.Invoke(this, "The save was successful, but we can no longer get an updated list of members from the server."); } UpdateMemberFailed?.Invoke(this, "Unable to save changes."); }
private async void LoadMembers() { members = (await GetAllMembers()).Payload; MembersChanged?.Invoke(this, null); }