Dex Save Vs Enemy Attack Roll

My party and I were battling a group of orcs and my character turns invisible but doesn’t move. The orc I was facing starts randomly swinging his blades in my general direction. I was in range but my DM made me roll a dex save rather than have the orc make an attack roll. Is this the correct call and for future reference how do you know when a dex save or attack roll should be made?