Merging his roles as the city's chief executive and a political candidate, Mayor Marion Barry appeared at a well-orchestrated rally yesterday to defend his record as the city's largest landlord to the poor and receive the endorsement of some public housing residents.

The afternoon affair, held in 90-degree temperatures at the Edgewood Terrace subsidized housing project in Northeast, attracted about 150 public housing tenants from throughout the city, most of them senior citizens.

Also present were several top Barry administration housing officials, ostensibly barred from partisan political activity by the Hatch Act.

"You can't find a record anywhere in the country that matches that record," said Barry, pointing to large, government-supplied charts asserting that his administration had spent $31 million to fix up about 25 percent of the city's nearly 12,000 public housing units since taking office in January 1979.

Barry's leading challenger in the quest for the Democratic nomination in the Sept. 14 primary, Patricia Roberts Harris, has contended that only 50 of those units were renovated in a major way and that most of the rest underwent lesser repairs, such as installation of downspouts or air conditioners.

It was an accusation that Barry never really denied yesterday, despite repeated questions from reporters.

"Everything is not where I want it to be, but we can all look back and say things are better than they were in 1978," he said.

Barry also was endorsed yesterday by The Washington Times.

"Things are not perfect here by any means," the editorial said, but Barry "is a man who has shown an ability to rise to occasions in the past. We think he can do so in the future. We think he should have the Democratic nomination for mayor of Washington, D.C."

Last week, Harris held her public housing press conference at the city-run Barry Farms project in Southeast, one of the city's worst. Barry's was held at a well-kept building managed not by the city, but by a company headed by D.C. City Council member H.R. Crawford (D-Ward 7), who has endorsed Barry.

The Barry rally was organized by a city-wide residents council whose chairman, Kimi Gray, is a Barry supporter and attended the rally.

It was another in a string of events Barry is using to maintain momentum in the final days of the campaign and fend off accusations by his three Democratic challengers -- Harris and council members John Ray and Charlene Drew Jarvis -- that his administration has been mediocre and unresponsive to public housing tenants.

Barry received the endorsement of residents from four of the city's 53 public housing developments. The tenants also endorsed Council Chairman Arrington Dixon, who is seeking the Democratic nomination for a second term and is being challenged by council member David A. Clarke and Sterling Tucker, a former council chairman.

Dixon, who had arrived around noon, found a small crowd and retreated to his city-leased air-conditioned car. He returned as the mayor headed for his limousine.

The charts that served as Barry's backdrop showed that in most of the 24 projects where the city had completed repairs, roofs and central heating and air-conditioning systems had been fixed and not individual apartments.

The 169-unit Kelly Miller Dwellings at the foot of Howard University and the 134-unit Ellen Wilson Apartments on Capitol Hill were the only two public housing projects cited by Barry where tenants had received new kitchens and bathrooms.