示例#1
0
        public async Task <IActionResult> Create([Bind("albumId,id,title,url,thumbnailUrl")] Photo photo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(photo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(photo));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("id,userId,title")] Album album)
        {
            if (ModelState.IsValid)
            {
                _context.Add(album);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(album));
        }