public bool TransferToBasket(Basket basket, string product) { LongRunningOperationSimulator.Simulate(); if (!_products.Contains(product) || !_products.Remove(product)) return false; basket.Add(product); return true; }
public bool TransferToBasket(Basket basket, string product) { if (!_products.Contains(product) || !_products.Remove(product)) { return(false); } basket.Add(product); return(true); }
public bool TransferToBasket(Basket basket, string product) { LongRunningOperationSimulator.Simulate(); if (!_products.Contains(product) || !_products.Remove(product)) { return(false); } basket.Add(product); return(true); }
public async Task <bool> TransferToBasketAsync(Basket basket, string product) { await LongRunningOperationSimulator.SimulateAsync(); if (!_products.Contains(product) || !_products.Remove(product)) { return(false); } basket.Add(product); return(true); }