namespace Simulator.DataStore.Stores { using Simulator.DataObjects; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; public class TripStore : BaseStore//, IBaseStore { public TripStore(IHttpClientFactory clientFactory, string EndPoint) : base(clientFactory) { base.InitializeStore(EndPoint); } public async Task GetItemAsync(string id) { Trip trip = null; HttpResponseMessage response = await Client.GetAsync($"/api/trips/{id}"); if (response.IsSuccessStatusCode) { response.Content.Headers.ContentType.MediaType = "application/json"; trip = await response.Content.ReadAsAsync(); } return trip; } public async Task> GetItemsAsync() { List trips = null; HttpResponseMessage response = await Client.GetAsync("api/trips/"); if (response.IsSuccessStatusCode) { response.Content.Headers.ContentType.MediaType = "application/json"; trips = await response.Content.ReadAsAsync>(); } return trips; } } }