public async Task <IActionResult> Create([Bind("BlogId,Title,Date,Image")] Blog blog)
        {
            if (ModelState.IsValid)
            {
                _context.Add(blog);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(blog));
        }
示例#2
0
        public async Task <IActionResult> Create([Bind("ContactId,Name,Email,Subject,Message")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(List)));
            }
            return(View(contact));
        }
        public async Task <IActionResult> Create([Bind("CommentId,Name,Star,Image,Job,Explanation")] Comment comment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(comment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(comment));
        }
示例#4
0
        public async Task <IActionResult> Create([Bind("DestinationId,Country,Place,Tour,CountryImage,PlaceImage,Price,TourDayCount")] Destination destination)
        {
            if (ModelState.IsValid)
            {
                _context.Add(destination);
                await _context.SaveChangesAsync();

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