/// <summary> /// Get API/Follow /// </summary> /// <returns>List de tous les Follow</returns> public IHttpActionResult Get() { if ((new[] { "Admin", "User" }).Contains(ValidateTokenAndRole.ValidateAndGetRole(Request), StringComparer.OrdinalIgnoreCase)) { IEnumerable <FollowModel> List = repo.GetAll().Select(Follow => Follow?.ToModel()); if (List.Count() == 0) { return(NotFound()); } else { return(Json(List)); } } else { return(Unauthorized()); } }
// GET: api/Follow public IEnumerable <Follow> Get() { return(db.GetAll()); }