public ActionResult Add2(FullPhotoViewModel qwe, HttpPostedFileBase main) { qwe.CategoryID = qwe.SelectedID.ElementAt(0); qwe.CreatedTime = DateTime.Now; PhotoService.AddPhoto(AutoMapper.Mapper.Map <IPhoto>(qwe), main); return(RedirectToAction("ShowAllPhotos", new { id = qwe.CategoryID })); }
//get public ActionResult Add() { FullPhotoViewModel qwe = new FullPhotoViewModel(); qwe.Items = CategoryService.GetAllCategories(). Select(x => new SelectListItem { Value = x.Id.ToString(), Text = x.Name }); return(View(qwe)); }