/// <summary> /// Get a single <see cref="Note"/> object /// </summary> /// <param name="id"></param> /// <returns></returns> public Note GetById(int id) { using (var repo = new NotesRepository()) { return(repo.Get(id)); } }
public IActionResult Get([FromQuery] string itemType, int userId) { var identity = HttpContext.User.Identity as ClaimsIdentity; var id = identity.FindFirst(ClaimTypes.Name).Value; int ID = Int32.Parse(id); try { return(Ok(NotesRepository.Get(itemType, ID))); } catch (Exception ex) { return(BadRequest($"Failed: {ex}")); } }
// GET: Notes/Details/5 public ActionResult Details(int id) { var model = _notesRepository.Get(id); return(View(model)); }