public async Task <IActionResult> Index() { var posts = Directory.GetFiles(postEnvironment, postExtention, SearchOption.TopDirectoryOnly); HeaderParser.CreateNewModel(); foreach (var post in posts) { using (var fileStream = new FileStream(post, FileMode.Open, FileAccess.Read)) { using (StreamReader reader = new StreamReader(fileStream)) { HeaderParser.CreateNewPost(post); for (int i = 0; i < 8; i++) { HeaderParser.ParsLine(await reader.ReadLineAsync()); } HeaderParser.MakeHeader(); } } } return(View(model: HeaderParser.GetPostList())); }