TransactionalNodeService.Common.TransactionalMappingToolServiceCommonBase.QueryDomains C# (CSharp) Method

QueryDomains() public method

public QueryDomains ( IGlymaSession glymaSession ) : QueryResponse>.Dictionary
glymaSession IGlymaSession
return QueryResponse>.Dictionary
        public Dictionary<Guid, QueryResponse> QueryDomains(IGlymaSession glymaSession)
        {
            using (IDbConnectionAbstraction mapDbConnection = glymaSession.ConnectionFactory.CreateMapDbConnection())
            {
                SqlCommand queryDomainMapCommand = new SqlCommand("SELECT [DomainUid], [NodeUid] FROM [Nodes] WHERE NodeTypeUid = '263754C2-2F31-4D21-B9C4-6509E00A5E94'", mapDbConnection.Connection);
                queryDomainMapCommand.CommandType = CommandType.Text;

                mapDbConnection.Open();

                SqlDataReader queryMapResults = queryDomainMapCommand.ExecuteReader();

                Dictionary<Guid, QueryResponse> domainResponses = new Dictionary<Guid, QueryResponse>();

                if (queryMapResults.HasRows)
                {
                    while (queryMapResults.Read())
                    {
                        Guid domainId = queryMapResults.GetGuid(0);
                        Guid nodeId = queryMapResults.GetGuid(1);

                        QueryResponse response = QueryMap(glymaSession, domainId, nodeId, 0, false, null, null, 0, false);
                        domainResponses[domainId] = response;
                    }
                }
                mapDbConnection.Close();

                try
                {
                    mapDbConnection.Open();
                    AuditLogItem logItem = new AuditLogItem(mapDbConnection.Connection);
                    logItem.OperationName = "QueryDomains";
                    //logItem.CallingUrl = callingUrl;
                    logItem.DomainUid = null;
                    logItem.NodeUid = null;
                    logItem.RootMapUid = null;
                    logItem.MaxDepth = null;
                    logItem.ObjectIndex = null;
                    logItem.EdgeConditions = null;
                    logItem.FilterConditions = null;
                    logItem.SearchConditions = null;
                    logItem.PageNumber = null;
                    logItem.PageSize = null;
                    logItem.Commit();
                    mapDbConnection.Close();
                }
                catch
                {
                    /// Don't do anything. This is here because audit logging is a very low importance task and we don't want it potentially killing the more important tasks at hand.
                }

                return domainResponses;
            }
        }