public async Task <IActionResult> Create([Bind("RaspunsId,IntrebareId,Data,Continut")] Raspuns raspuns) { var utilizator = await utilizatorService.GetCurrentUser(HttpContext.User); if (ModelState.IsValid) { raspunsService.Create(raspuns, utilizator); return(RedirectToAction(nameof(Index))); } ViewData["IntrebareId"] = new SelectList(raspunsService.GetAllIntrebari(), "IntrebareId", "Continut", raspuns.IntrebareId); return(View(raspuns)); }
// GET: Intrebares/Create public async Task <IActionResult> Create() { var utilizator = await utilizatorService.GetCurrentUser(HttpContext.User); return(View()); }