Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple Web API
public class ApplicationUsersController : Controller
private readonly ApplicationDbContext _context;
public ApplicationUsersController(ApplicationDbContext context)
_context = context;
// GET: api/ApplicationUsers/5
public async Task<IActionResult> GetApplicationUser([FromRoute] string id)
var applicationUser = await _context.Users.SingleOrDefaultAsync(m => m.Id == id);
if (applicationUser == null)
return NotFound();
return Ok(applicationUser);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment