public void AddAdult(Adult adult) { int i = Adults.Count + 1; adult.Id = i; Adults.Add(adult); Firstnames.Add(adult.FirstName); Lastnames.Add(adult.LastName); HairColors.Add(adult.HairColor); EyeColors.Add(adult.EyeColor); Ids.Add(adult.Id); Jobs.Add(adult.Job); }
static async Task <string> PostData(Adult adult) { var httpClientHandler = new HttpClientHandler { ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true }; HttpClient client = new HttpClient(httpClientHandler); string adultSerialized = JsonSerializer.Serialize(adult); StringContent content = new StringContent( adultSerialized, Encoding.UTF8, "application/json" ); HttpResponseMessage response = await client.PutAsync("https://localhost:5001/Adult", content); return(response.ToString()); }
public void Update(Adult toUpdate) { JobTitle = toUpdate.JobTitle; base.Update(toUpdate); }
public void Update(Adult toUpdate) { Job = toUpdate.Job; base.Update(toUpdate); }
public void addAdult(Adult adult) { PostData(adult); }