private static void SetAdminUserPermissions(ref UserPrincipal serializeModel) { IDatabaseFactory databaseFactory = new DatabaseFactory(); IAdminUserRepository adminUserRepository = new AdminUserRepository(databaseFactory); IAdminRoleRepository adminRoleRepository = new AdminRoleRepository(databaseFactory); IUnitOfWork unitOfWork = new UnitOfWork(databaseFactory); IAdminUserService adminUserService = new AdminUserService(adminUserRepository, adminRoleRepository, unitOfWork); serializeModel.Permissions = adminUserService.GetPermissions(serializeModel.UserId); serializeModel.Roles = adminUserService.GetRoles(serializeModel.UserId); }