Esempio n. 1
0
        // Manufacturer

        // ############################################################
        // Get all as list, get all, get one

        public IEnumerable <ManufacturerList> GetAllManufacturersAsList()
        {
            // Fetch from the persistent store
            var fetchedObjects = ds.Manufacturers.OrderBy(man => man.Name);

            // Prepare the view model objects...

            // Create a collection
            var manufacturers = new List <ManufacturerList>();

            // Go through the fetch results
            foreach (var item in fetchedObjects)
            {
                var man = new ManufacturerList();
                man.Id   = item.Id;
                man.Name = item.Name;
                manufacturers.Add(man);
            }

            // Return the result
            return(manufacturers);
        }
Esempio n. 2
0
        // Manufacturer
        // ############################################################
        // Get all as list, get all, get one
        public IEnumerable<ManufacturerList> GetAllManufacturersAsList()
        {
            // Fetch from the persistent store
            var fetchedObjects = ds.Manufacturers.OrderBy(man => man.Name);

            // Prepare the view model objects...

            // Create a collection
            var manufacturers = new List<ManufacturerList>();

            // Go through the fetch results
            foreach (var item in fetchedObjects)
            {
                var man = new ManufacturerList();
                man.Id = item.Id;
                man.Name = item.Name;
                manufacturers.Add(man);
            }

            // Return the result
            return manufacturers;
        }