protected override async Task ExtractDatabaseEntityDeclarationsAsync(Solution solution, IProgress <ExtractionProgress> progress) { string extractionNote = "Extracting Database Entity Declarations by finding all IQueryable<T> properties in Data Context Declarations"; progress.Report(new ExtractionProgress(extractionNote)); int totalAmountOfDataContextClasses = GetTotalAmountOfDataContextClasses(); int counter = 0; foreach (var dataContextClassDeclarationSyntax in Context.DataContextDeclarations) { counter++; progress.Report(GetExtractionProgress(totalAmountOfDataContextClasses, counter)); CompilationInfo compInfo = dataContextClassDeclarationSyntax.CompilationInfo; foreach (var propertyDeclarationSyntax in compInfo.SyntaxNode.DescendantNodes().OfType <PropertyDeclarationSyntax>()) { SemanticModel model = compInfo.SemanticModel; if (model.IsOfType <IQueryable>(propertyDeclarationSyntax)) { TypeSyntax propertyType = propertyDeclarationSyntax.Type; //Get T from DbSet<T> or IQueryable<T> string entityClassName = (propertyType as GenericNameSyntax).TypeArgumentList.Arguments[0].ToFullString(); Dictionary <ClassDeclarationSyntax, SemanticModel> entityClass = await solution.GetClassesOfType(entityClassName); if (entityClass.Keys.Count > 0) { ClassDeclarationSyntax entityClassDeclarationSyntax = entityClass.Keys.First(); SemanticModel modelForEntityClass = entityClass[entityClassDeclarationSyntax]; DatabaseEntityDeclarations.Add(new DatabaseEntityDeclaration <EntityFramework>(entityClassName, entityClassDeclarationSyntax.GetCompilationInfo(modelForEntityClass))); } } } } }