public QueryResponse CreateRootMap(IGlymaSession glymaSession, Guid domainId, string name, NodeType nodeType, string originalId)
{
IDbConnectionAbstraction mapDbConnection = null;
IDbConnectionAbstraction parametersDbConnection = null;
IDbConnectionAbstraction sessionDbConnection = null;
try
{
mapDbConnection = glymaSession.ConnectionFactory.CreateMapDbConnection();
parametersDbConnection = glymaSession.ConnectionFactory.CreateParametersDbConnection();
sessionDbConnection = glymaSession.ConnectionFactory.CreateSessionDbConnection();
CreateRootMap createRootMapOperation = new CreateRootMap(mapDbConnection, parametersDbConnection, sessionDbConnection);
mapDbConnection.Open();
parametersDbConnection.Open();
sessionDbConnection.Open();
Guid nodeId = createRootMapOperation.Create(domainId, name, nodeType, originalId);
sessionDbConnection.Close();
parametersDbConnection.Close();
mapDbConnection.Close();
QueryResponse response = QueryMap(glymaSession, domainId, nodeId, 0, false, null, null, 0, false);
return response;
}
finally
{
if (mapDbConnection != null)
{
mapDbConnection.Dispose();
}
if (parametersDbConnection != null)
{
parametersDbConnection.Dispose();
}
if (sessionDbConnection != null)
{
sessionDbConnection.Dispose();
}
}
}