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

DeleteRootMap() public method

public DeleteRootMap ( IGlymaSession glymaSession, System.Guid domainId, System.Guid rootMapId ) : int
glymaSession IGlymaSession
domainId System.Guid
rootMapId System.Guid
return int
        public int DeleteRootMap(IGlymaSession glymaSession, Guid domainId, Guid rootMapId)
        {
            IDbConnectionAbstraction mapDbConnection = null;
            IDbConnectionAbstraction parametersDbConnection = null;
            IDbConnectionAbstraction sessionDbConnection = null;

            int deletions = -1;

            try
            {
                mapDbConnection = glymaSession.ConnectionFactory.CreateMapDbConnection();
                parametersDbConnection = glymaSession.ConnectionFactory.CreateParametersDbConnection();
                sessionDbConnection = glymaSession.ConnectionFactory.CreateSessionDbConnection();

                DeleteRootMap deleteRootMapOperation = new DeleteRootMap(mapDbConnection, parametersDbConnection, sessionDbConnection);

                mapDbConnection.Open();
                parametersDbConnection.Open();
                sessionDbConnection.Open();

                deletions = deleteRootMapOperation.ExecuteDeletion(domainId, rootMapId);

                sessionDbConnection.Close();
                parametersDbConnection.Close();
                mapDbConnection.Close();
            }
            finally
            {
                if (mapDbConnection != null)
                {
                    mapDbConnection.Dispose();
                }

                if (parametersDbConnection != null)
                {
                    parametersDbConnection.Dispose();
                }

                if (sessionDbConnection != null)
                {
                    sessionDbConnection.Dispose();
                }
            }

            return deletions;
        }