Example #1
0
        public async Task <IActionResult> Create(Developer developer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(developer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(developer));
        }
Example #2
0
        public async Task <IActionResult> Post([FromBody] Developer developer)
        {
            _context.Add(developer);
            await _context.SaveChangesAsync();

            return(Created(developer));
        }
Example #3
0
        public async Task <IActionResult> Post([FromBody] House house)
        {
            _context.Add(house);
            await _context.SaveChangesAsync();

            return(Created(house));
        }