This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BlogEntry | |
{ | |
[Key] | |
public string Id { get; set; } | |
[Required] | |
[MaxLength(200)] | |
public string Title { get; set; } | |
[Required] | |
public string Text { get; set; } | |