private int GetMenuIdFromModuleId(int parentId) { int menuId = 0; using (var session = new DataSession()) { var modulesRepo = new ModulesRepository(session.UnitOfWork); menuId = modulesRepo.GetMenuIdFromModuleId(parentId); } return(menuId); }