示例#1
0
        public IActionResult CreateVideo(NewVideoInputModel model)
        {
            if (ModelState.IsValid)
            {
                videosService.AddNewVideo(model.Name, model.VideoUrl);

                string content = string.Format("{0} added video: {1}", GetCurrentUserName(User.GetUserId()), model.Name);
                logsService.AddNewLog("Create", content);

                return(RedirectToAction("ViewVideos"));
            }
            else
            {
                return(View());
            }
        }