public static MvcHtmlString ImagePropertyFor <T, TValue>(this HtmlHelper <T> html,
                                                          Expression <Func <T, TValue> > propExpr,
                                                          PictureProfile pictureProfile)
 {
     return(html.PropertyFor(propExpr,
                             new { PictureProfile = pictureProfile }));
 }
Ejemplo n.º 2
0
        public static void Run()
        {
            var addressmapper                = new AddressProfile();
            var categorymapper               = new CategoryProfile();
            var customermapper               = new CustomerProfile();
            var customerRolemapper           = new CustomerRoleProfile();
            var manufacturermapper           = new ManufacturerProfile();
            var picturemapper                = new PictureProfile();
            var productAttributemapper       = new ProductAttributeProfile();
            var productmapper                = new ProductProfile();
            var specificationAttributemapper = new SpecificationAttributeProfile();
            var tierPricemapper              = new TierPriceProfile();

            var config = new MapperConfiguration(cfg => {
                cfg.AddProfile(addressmapper.GetType());
                cfg.AddProfile(categorymapper.GetType());
                cfg.AddProfile(customermapper.GetType());
                cfg.AddProfile(customerRolemapper.GetType());
                cfg.AddProfile(manufacturermapper.GetType());
                cfg.AddProfile(picturemapper.GetType());
                cfg.AddProfile(productAttributemapper.GetType());
                cfg.AddProfile(productmapper.GetType());
                cfg.AddProfile(specificationAttributemapper.GetType());
                cfg.AddProfile(tierPricemapper.GetType());
            });

            AutoMapperConfiguration.Init(config);
        }
 public ImageViewModel(ContentReference image, PictureProfile profile)
 {
     Image   = image;
     Profile = profile;
 }