Photo

Hillary Clinton tried to highlight her New York City credentials this weekend, bouncing from shaking hands at Junior’s Cheesecake in Brooklyn to holding a rally in the borough’s Sunset Park neighborhood and making a cameo at a black-tie roast with the city’s voracious press corps.

On Sunday, Mrs. Clinton capped off the whirlwind weekend with stops at three churches in Queens as her husband spoke at black churches in Harlem.

At the Inner Circle roast on Saturday night, held at the Hilton hotel in Midtown Manhattan, Mrs. Clinton joined Mayor Bill de Blasio onstage and to poke fun at his delay in backing her (“Thanks for the endorsement, Bill,” she said. “Took you long enough.”) and to implore him to fix an urgent problem.

“There are a lot of things I could ask you of international, national, city and state importance,” she said. “Will you just fix those MetroCard slots? It took me, like, five swipes,” she said. “Fix the turnstiles.”

Mrs. Clinton said the mayor, who managed her New York senate campaign, was her “second favorite guy named Bill.”

Her favorite Bill, her husband, got into some hot water on Thursday when he interrupted black protesters to defend his record in reducing crime and lifting African American families out of poverty. Facing intense backlash, Mr. Clinton said later he “almost” wanted to apologize.

There was no animosity on Saturday when Mrs. Clinton, accompanied by State Assemblyman Walter T. Mosley; Representative Hakeem Jeffries, Democrat of New York; and New York City Councilwoman Laurie Cumbo, shook hands with mostly black New Yorkers at Junior’s, the iconic cheesecake hub on Flatbush Avenue in downtown Brooklyn.

Asked by a reporter how the cheesecake was, Mrs. Clinton, who appeared to lust over a slice of strawberry cheesecake, demurred. “I learned early on not to eat in front of all of you,” she said. “Pining for a bite!”

Another view of @HillaryClinton pining for that cheesecake, but not taking a single bite. pic.twitter.com/i5xwz46PSs — erica orden (@eorden) April 9, 2016

Senator Bernie Sanders of Vermont, who was born in Brooklyn, has also tried to play up his New York City roots, taking in the hit musical “Hamilton” on Friday night with his wife, Jane, and holding a rally in front of his childhood home in Brooklyn.

Asked about her increasingly brash opponent, Mrs. Clinton applied the same discipline as she did to her dietary choices. “Oh, I’m talking cheesecake,” she said. “Cheesecake! Look at this fabulous cheesecake!”

On Sunday, at the Greater Allen Cathedral church in Jamaica, Queens, the pastor, the Rev. Dr. Floyd Flake, praised Mr. Clinton’s record. “So many jobs, that’s what it’s all about,” Mr. Flake said before announcing Mrs. Clinton.

Never one to miss an opportunity to underscore her long roots in the city, Mrs. Clinton opened her remarks by saying she remembered Mr. Flake sitting “in my kitchen all those years ago, eating cookies, drinking lemonade.”

Oh, and did she mention the Clintons saw “Hamilton” over a year ago, when it was still off Broadway at the Public Theater?