C# Класс EFLinqAnalyzer.LinqExpressionValidator

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
MemberAccessIsAccessingDbContext ( MemberAccessExpressionSyntax memberExpr, SyntaxNodeAnalysisContext context, EFUsageContext efContext, EFCodeFirstClassInfo &clsInfo ) : bool
ValidateLinqToEntitiesExpression ( LambdaExpressionSyntax lambda, EFCodeFirstClassInfo rootQueryableType, SyntaxNodeAnalysisContext context, EFUsageContext efContext, bool treatAsWarning = false ) : void

Validates the given lambda to see if it is a valid LINQ to Entities expression

ValidateLinqToEntitiesUsageInSyntaxNodes ( IEnumerable descendants, EFCodeFirstClassInfo rootQueryableType, SyntaxNodeAnalysisContext context, EFUsageContext efContext, ContextualLinqParameter>.Dictionary parameterNodes, bool treatAsWarning ) : void

Validates the series of syntax nodes for valid usages of LINQ to Entities constructs

Приватные методы

Метод Описание
DoesMethodReturnDbSet ( Microsoft.CodeAnalysis.CSharp.Syntax.IdentifierNameSyntax methodIdent, SyntaxNodeAnalysisContext context, EFUsageContext efContext, EFCodeFirstClassInfo clsInfo ) : bool
IsSupportedLinqToEntitiesMethod ( InvocationExpressionSyntax node, MemberAccessExpressionSyntax memberExpr, EFCodeFirstClassInfo rootQueryableType, EFUsageContext efContext, SyntaxNodeAnalysisContext context ) : bool
ReturnStatementTracesBackToDbSet ( Microsoft.CodeAnalysis.CSharp.Syntax.ReturnStatementSyntax ret, SyntaxNodeAnalysisContext context, EFCodeFirstClassInfo clsInfo ) : bool
SymbolCanBeTracedBackToDbContext ( ISymbol sym, SyntaxNodeAnalysisContext context, EFUsageContext efContext, EFCodeFirstClassInfo clsInfo ) : bool
ValidateMemberAccessInLinqExpression ( MemberAccessExpressionSyntax node, EFCodeFirstClassInfo rootQueryableType, SyntaxNodeAnalysisContext context, ContextualLinqParameter>.Dictionary parameterNodes, bool treatAsWarning ) : void
ValidateMethodCallInLinqExpression ( InvocationExpressionSyntax node, EFCodeFirstClassInfo rootQueryableType, SyntaxNodeAnalysisContext context, EFUsageContext efContext, ContextualLinqParameter>.Dictionary parameterNodes, bool treatAsWarning ) : void
ValidateNavigationPropertyAccess ( InvocationExpressionSyntax node, SyntaxNodeAnalysisContext context, EFUsageContext efContext, bool treatAsWarning, string memberName, EFCodeFirstClassInfo cls ) : void

Описание методов

MemberAccessIsAccessingDbContext() публичный статический Метод

public static MemberAccessIsAccessingDbContext ( MemberAccessExpressionSyntax memberExpr, SyntaxNodeAnalysisContext context, EFUsageContext efContext, EFCodeFirstClassInfo &clsInfo ) : bool
memberExpr MemberAccessExpressionSyntax
context SyntaxNodeAnalysisContext
efContext EFUsageContext
clsInfo EFCodeFirstClassInfo
Результат bool

ValidateLinqToEntitiesExpression() публичный статический Метод

Validates the given lambda to see if it is a valid LINQ to Entities expression
public static ValidateLinqToEntitiesExpression ( LambdaExpressionSyntax lambda, EFCodeFirstClassInfo rootQueryableType, SyntaxNodeAnalysisContext context, EFUsageContext efContext, bool treatAsWarning = false ) : void
lambda LambdaExpressionSyntax The lambda syntax node
rootQueryableType EFCodeFirstClassInfo The type of the IQueryable instance where a known LINQ operator is invoked on with this lambda
context SyntaxNodeAnalysisContext The analysis context
efContext EFUsageContext The EF-specific view of the semantic model
treatAsWarning bool If true, instructs any diagnostic reports to be flagged as warnings instead of errors. This is normally true when the analyzer cannot fully determine that the LINQ expression is made against an actual DbSet
Результат void

ValidateLinqToEntitiesUsageInSyntaxNodes() публичный статический Метод

Validates the series of syntax nodes for valid usages of LINQ to Entities constructs
public static ValidateLinqToEntitiesUsageInSyntaxNodes ( IEnumerable descendants, EFCodeFirstClassInfo rootQueryableType, SyntaxNodeAnalysisContext context, EFUsageContext efContext, ContextualLinqParameter>.Dictionary parameterNodes, bool treatAsWarning ) : void
descendants IEnumerable
rootQueryableType EFCodeFirstClassInfo
context SyntaxNodeAnalysisContext
efContext EFUsageContext
parameterNodes ContextualLinqParameter>.Dictionary
treatAsWarning bool
Результат void