public IActionResult Index() { PostsIndex postsIndex = new PostsIndex(); postsIndex.UserLoggedID = HttpContext.User.FindFirst("UserID").Value.ToString(); postsIndex.ImagePath = HttpContext.User.FindFirst("ImagePath").Value.ToString(); postsIndex.UserLogged = HttpContext.User.FindFirst("Nome").Value.ToString(); postsIndex.Posts = dataBase.GetPostsFriends(postsIndex.UserLoggedID); return(View("index", postsIndex)); }
public PostsIndex GeneratePostsIndex() { var fileStream = new FileStream(_BulkDataFiles.PostsPath, FileMode.Open, FileAccess.Read); var reader = XmlReader.Create(fileStream); var result = new PostsIndex(); while (reader.ReadToFollowing("row")) { result.TotalRecordCount++; while (reader.MoveToNextAttribute()) { if (reader.Name == "Id") { var position = (int)fileStream.Position / 8192; result.PostIDPositionsInXML.Add(Int32.Parse(reader.Value), position); continue; } } } return(result); }