Example #1
0
        internal static List <T> GetAllItems <T>()
        {
            if (typeof(Company) == typeof(T))
            {
                return(Companies.Cast <T>().ToList());
            }

            if (typeof(Product) == typeof(T))
            {
                return(Products.Cast <T>().ToList());
            }

            if (typeof(Supplier) == typeof(T))
            {
                return(Suppliers.Cast <T>().ToList());
            }

            if (typeof(SupplierProductBarcode) == typeof(T))
            {
                return(SupplierProductBarcodes.Cast <T>().ToList());
            }

            return(null);
        }