public JsonResult Get([FromQuery] int offset = 0, [FromQuery] int limit = 3) { if (AuthRepo.IsAuthenticated()) { int count; var records = AppRepo.GetAllRecords( AuthRepo.CurrentUserId, limit, offset, out count); return(Json(new { Count = count, Records = records })); } Response.StatusCode = 401; return(Json(new { Msg = "Unauthorized" })); }