예제 #1
0
        private bool hasBaseClass(SemanticModel model, ClassDeclarationSyntax syntax)
        {
            var classDeclaration = syntax.GetClassDeclaration();

            if (classDeclaration == null)
            {
                return(false);
            }

            var symbol = model.GetDeclaredSymbol(classDeclaration) as INamedTypeSymbol;

            if (symbol == null)
            {
                return(false);
            }

            //First check, make sure class is inheriting from a candidate
            if (!symbol.InheritsFrom(_CLASS_DECLARATIONS))
            {
                return(false);
            }


            if (!isMissingAuthorizeAttribute(model, classDeclaration.AttributeLists))
            {
                return(false);
            }

            return(true);
        }