public int AddView(int id) { Keep keep = _repo.GetById(id); keep.Views++; _repo.Update(keep); return(keep.Views); }
public IActionResult GetById([FromRoute] int id) { try { return(Ok(_repo.GetById(id))); } catch (Exception error) { return(BadRequest(error.Message)); } }
public ActionResult <Keep> Get(int id) { Keep result = _keepRepo.GetById(id); if (result != null) { return(Ok(result)); } return(BadRequest()); }
public ActionResult <Keep> Get(int id) { Keep found = _kr.GetById(id); if (found == null) { return(BadRequest("Something has gone horribly wrong")); } return(Ok(found)); }
public ActionResult <Keep> Get(int id) { Keep found = _pr.GetById(id); if (found == null) { return(BadRequest()); } return(Ok(found)); }
public ActionResult <Keep> GetById(int id) { try { return(Ok(_repo.GetById(id))); } catch (Exception e) { return(BadRequest(e)); } }
public Keep GetbyId(int id) { return(_repo.GetById(id)); }
public IEnumerable <Keep> GetById(string userId) { userId = HttpContext.User.Identity.Name; return(_repo.GetById(userId)); }
public IEnumerable <Keep> Get(string userid) { return(_repo.GetById(userid)); }