Exemplo n.º 1
0
        public IStatement GetStatement(object commandType)
        {
            Type type = (Type)commandType;

            if (!statements.ContainsKey(type))
            {
                lock (statements)
                {
                    if (!statements.ContainsKey(type))
                    {
                        IStatement command = attributeReader.ReadStatementAttribute(type);
                        if (command == null)
                        {
                            throw AttributeException.AttributeNotFoundException(type, typeof(StatementAttribute));
                        }
                        command.CreateCache();
                        statements.Add(type, command);
                    }
                }
            }
            return(statements[type]);
        }