Exemple #1
0
        public async Task <IActionResult> Create([Bind("PlaceID,PlaceAdress,PlaceDescription")] Place place)
        {
            if (ModelState.IsValid)
            {
                _context.Add(place);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(place));
        }
Exemple #2
0
        public async Task <IActionResult> Create([Bind("ToolID,Type,Description,PlaceID")] Tool tool)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tool);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            PlaceList(tool.PlaceID);
            return(View(tool));
        }