Пример #1
0
        public ActionResult Edit(int id)
        {
            var modelMap = Mapper.Map <ShippingMethod, ShippingMethodViewModel>(_paymentMethodService.Get(x => x.Id == id));

            //Add Locales to model
            AddLocales(_languageService, modelMap.Locales, (locale, languageId) =>
            {
                locale.Id          = modelMap.Id;
                locale.LocalesId   = modelMap.Id;
                locale.Name        = modelMap.GetLocalized(x => x.Name, id, languageId, false, false);
                locale.Description = modelMap.GetLocalized(x => x.Description, id, languageId, false, false);
            });

            return(View(modelMap));
        }