Example #1
0
 public async Task <ProjectFileData> ReadProjectFileAsync(SolutionFileData solution, ProjectFileData projectFile)
 {
     return(await Task.Run(() =>
     {
         using (var projectStream = File.OpenRead(projectFile.ProjectPath))
         {
             return _parser.ParseProject(projectFile, solution, projectStream).Result;
         }
     }).ConfigureAwait(false));
 }
        public async Task <ProjectFileData> ParseProject(ProjectFileData projectFile, SolutionFileData solution,
                                                         FileStream projectStream)
        {
            using (var reader = new StreamReader(projectStream))
            {
                var projectDocument = XDocument.Load(reader);

                var projectObject = await Task.Run(() => _projectReader(projectDocument))
                                    .ConfigureAwait(false);

                var mapper = _mapperConfig.CreateMapper();

                return(mapper.Map <ProjectFileData>(Tuple.Create(solution, projectFile, projectObject)));
            }
        }