public IEnumerable<ManufacturerBase> GetAllManufacturers()
{
// Fetch from the persistent store
var fetchedObjects = ds.Manufacturers.OrderBy(man => man.Name);
// Prepare and return the view model objects
return Mapper.Map<IEnumerable<ManufacturerBase>>(fetchedObjects);
/*
// Prepare the view model objects...
// Create a collection
var manufacturers = new List<ManufacturerBase>();
// Go through the fetch results
foreach (var item in fetchedObjects)
{
var man = new ManufacturerBase();
man.Id = item.Id;
man.Name = item.Name;
man.Country = item.Country;
man.YearStarted = item.YearStarted;
manufacturers.Add(man);
}
// Return the result
return manufacturers;
*/
}