public ActionResult Add(VideoCategoryInfo categoryInfo)
        {
            if (ModelState.IsValid)
            {
                this.VideoCatService.AddVideoCategory(VideoCategoryInfo.ToVideoCategory(categoryInfo));

            }
            return RedirectToAction("List");
        }
 public ActionResult Edit(VideoCategoryInfo categoryInfo)
 {
     if (ModelState.IsValid)
     {
         VideoCategory category = VideoCategoryInfo.ToVideoCategory(categoryInfo);
         this.VideoCatService.UpdateVideoCategory(category);
     }
     return RedirectToAction("List");
 }
Пример #3
0
 public static VideoCategory ToVideoCategory(VideoCategoryInfo categoryInfo)
 {
     return new VideoCategory
     {
         Id = categoryInfo.Id,
         Name = categoryInfo.Name,
         Description = categoryInfo.Description
     };
 }