Skip to content

Instantly share code, notes, and snippets.

@marcfabregatb
Created August 8, 2021 19:32
Show Gist options
  • Save marcfabregatb/e894723d113ce0cb959d12395327ef56 to your computer and use it in GitHub Desktop.
Save marcfabregatb/e894723d113ce0cb959d12395327ef56 to your computer and use it in GitHub Desktop.
quering values
public async Task<IActionResult> Edit(string id)
{
if (string.IsNullOrWhiteSpace(id))
{
return NotFound();
}
var blogEntry = await _context.BlogEntries.Include(x => x.Categories).FirstOrDefaultAsync(x => x.Id == id);
if (blogEntry == null)
{
return NotFound();
}
return View(blogEntry);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment