public async Task <IActionResult> Create([Bind("Id,PhotoPath,Heading,Title,Link")] Ad ad)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ad);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ad));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Logo,Phone,Email,Description,Facebook,Twitter,Instagram")] Setting setting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(setting);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(setting));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,Name")] City city)
        {
            if (ModelState.IsValid)
            {
                _context.Add(city);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(city));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Price")] Shipping shipping)
        {
            if (ModelState.IsValid)
            {
                _context.Add(shipping);
                await _context.SaveChangesAsync();

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