archive
/
product-list
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
product-list/Storage.cs

30 lines
532 B
C#
Raw Normal View History

using System;
using System.Collections.Generic;
namespace productlist
{
public static class Storage
{
private static List<Product> productStorageList = new List<Product>();
public static void Add(Product p) {
productStorageList.Add (p);
}
private static void listProducts() {
if (productStorageList.Count < 1) {
Console.WriteLine ("No Products found!");
return;
}
foreach (Product p in productStorageList) {
p.display ();
}
}
public static void List() {
listProducts ();
}
}
}