public static ObjectIdentifier GetIdentifierFromSqlProcedure(TSqlFragment fragment) { var identifier = new ObjectIdentifier(); var symbolVisitor = new ProcedureObjectNameVisitor(identifier); fragment.Accept(symbolVisitor); return(identifier); }
public ComparedEntity Create(string representation) { if (representation == null) { Logger.Error($"{nameof(representation)} is null"); throw new ArgumentNullException(nameof(representation)); } var parsedFragment = _fragmentFactory.CreateFragment(representation); var result = new ComparedEntity { Tree = parsedFragment.Fragment, ParseErrors = parsedFragment.ParseErrors, Representation = representation }; var symbolVisitor = new ProcedureObjectNameVisitor(result.Identifier); result.Tree.Accept(symbolVisitor); return(result); }