public async Task <IActionResult> Create([Bind("Id,LocationName")] Locations locations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(locations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(locations));
        }
Example #2
0
 public void Add(Location location)
 {
     context.Add(location);
     context.SaveChanges();
 }