public ProductViewModel AutoMappingProductViewModel(Product p)
        {
            ProductViewModel model = new ProductViewModel();
            var soc = new SpecialOfferController();
            var rec = new RevisionController();

            //Add all revisions to product via viewmodels
            model.RevisionsInProduct = new List <RevisionViewModel>();
            foreach (Revision r in rec.RetrieveAllRevisionsByProductId(p.RetrieveProductId()))
            {
                var mapperOne            = mapextension.RevisionToRevisionViewModel();
                RevisionViewModel rmodel = mapperOne.Map <RevisionViewModel>(r);
                model.RevisionsInProduct.Add(rmodel);
            }

            //Add all categories from product to model via viewmodels
            model.ProductCategories = new List <CategoryOverviewViewModel>();
            foreach (Category c in categoryRep.RetrieveCategoriesFromProduct(p))
            {
                var mapperTwo = mapextension.CategoryToCategoryOverviewViewModel();
                CategoryOverviewViewModel cmodel = mapperTwo.Map <CategoryOverviewViewModel>(c);
                model.ProductCategories.Add(cmodel);
            }

            //Add all categories in system to model via viewmodels
            model.ListOfAllCategories = new List <CategoryOverviewViewModel>();
            foreach (Category c in categoryRep.RetrieveAllCategories())
            {
                var mapperThree = mapextension.CategoryToCategoryOverviewViewModel();
                CategoryOverviewViewModel cmodelsystem = mapperThree.Map <CategoryOverviewViewModel>(c);
                model.ListOfAllCategories.Add(cmodelsystem);
            }

            return(model);
        }