Why Can't Struct Be Used Instead Of Class For Storing Entity?

user image

Muskan Anand

2 years ago

Struct is of value type. If we pass it across methods in layers, a new object will be created in the stack thus increasing memory and processing requirement. So class should be used for creating entity like Employee, Supplier etc.

Recent Doubts

Close [x]