Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async Task<IActionResult> Delete(int? id)
- {
- if (id == null)
- {
- return NotFound();
- }
- var country = await _context.Countries
- .SingleOrDefaultAsync(m => m.Id == id);
- if (country == null)
- {
- return NotFound();
- }
- return PartialView(country);
- }
- public class Country
- {
- public int Id { get; set; }
- [Required]
- public string Name { get; set; }
- }
- public class City
- {
- public int Id { get; set; }
- [Required]
- public string Name { get; set; }
- public Country Country { get; set; }
- }
Add Comment
Please, Sign In to add comment