This code, part of 1 method, will call 3 others methods
..
var userId = LookUpLocalUser(userName);
if (userId == 0)
{
userId = InsertUser(userName, userName);
AddRoleToUser(userId, (int)Roles.Admin);
AddRoleToUser(userId, (int)Roles.User);
}
guid = LoginUser(userId);
..
Each of these methods (LookUpLoacalUser, AddToRole, LoginUser) will do something on the database. So my question is. What is better, to let each method open a connection to the database(and close it, using using
) or should I open just one connection and pass it to each method?