public ApiUser Index(String name) { var currentUserId = CurrentUser != null ? CurrentUser.Id : new Guid(); var apiUser = usersLogic.GetApiUserByNameWithFollowings(name, currentUserId); if (apiUser == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } return(apiUser); }
public ActionResult Profile(String name, int skip = 0) { ActionResult result = new HttpNotFoundResult(); var currentUserId = CurrentUser != null ? CurrentUser.Id : new Guid(); var apiUser = usersLogic.GetApiUserByNameWithFollowings(name, currentUserId); if (apiUser != null) { var patterns = patternsLogic.GetUsersPatterns(apiUser.Id, currentUserId, skip, Configuration.PageSize); var model = new UserModel() { Gallery = GetGalleryModel(patterns, skip), User = apiUser, CurrentUser = CurrentUser }; result = Request.IsAjaxRequest() ? View("Gallery", model.Gallery) : View(model); } return(result); }