public async Task <DataPage <PriceV1> > GetPricesAsync(string correlationId, FilterParams filter, PagingParams paging) { return(await _persistence.GetPageByFilterAsync(correlationId, filter, paging)); }
public async Task TestCrudOperationsAsync() { // Create items await TestCreatePricesAsync(); // Get all prices var page = await _persistence.GetPageByFilterAsync( null, new FilterParams(), new PagingParams() ); Assert.NotNull(page); Assert.Equal(3, page.Data.Count); var price1 = page.Data[0]; // Update the price price1.Note = "ABC"; var price = await _persistence.UpdateAsync(null, price1); Assert.NotNull(price); Assert.Equal(price1.Id, price.Id); Assert.Equal("ABC", price.Note); // Get price by udi price = await _persistence.GetOneBySkuAsync(null, price1.Sku); Assert.NotNull(price); Assert.Equal(price1.Id, price.Id); // Delete the price price = await _persistence.DeleteByIdAsync(null, price1.Id); Assert.NotNull(price); Assert.Equal(price1.Id, price.Id); // Try to get deleted price price = await _persistence.GetOneByIdAsync(null, price1.Id); Assert.Null(price); }