// GET: vediosTbls public async Task <ActionResult> Index() { var lst = await db.vediosTbls.ToListAsync(); VedioViewModel vm = new VedioViewModel() { ListOfVedios = lst }; return(View(vm)); }
public async Task <ActionResult> Create(VedioViewModel vedioViewModel) { vediosTbl vediosTbl = vedioViewModel.Vedio; if (ModelState.IsValid) { db.vediosTbls.Add(vediosTbl); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(vediosTbl)); }