Both Hillary and Bernie got way more votes than Trump in New York. Combine that Hillary/Bernie vote and you see how foolish Trump is to claim he will carry New York in the general.
Most New Yorkers are registered Democrats, because that’s what they need to vote for local officials, folks who run the garbage collection, plow the roads, clean the sidewalks, and the like. But when they vote statewide, they often vote Republican if that seems like the better candidate. It’s just that it’s important to be able to vote in the Democrat primaries.