Created
November 22, 2019 08:42
-
-
Save AdoraNwodo/a985da996342606ee2e13c7745a4bf4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Store | |
{ | |
private List<string> storeProducts; | |
public Store() | |
{ | |
storeProducts = new List<string>(); | |
} | |
async Task<string> GetOrAddProduct(Product product) | |
{ | |
if(storeProducts.Contains(product.Name)) | |
{ | |
return product; | |
} | |
var token = HelperClass.GenerateTokenOrSomething(); | |
await HelperClass.UploadProductDetails(token, product); | |
storeProducts.Add(product.Name); | |
return product.Name; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment