Click here to Skip to main content
15,886,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

what is exactly happening in auto-implemented properties over properties?

According to my knowledge automated properties create backup fields to properties, if so how its happening?

Thanks
Posted

properity defines collection of set and get methods with body.....
but auto implemented properity defines set and get methods without body ...that's all
 
Share this answer
 
The compiler does it.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Sep-13 0:51am    
5ed. I recently answered in detail, but my answer was removed, as many others, due to abuse reports on the question.
I think this answer is just enough. :-)
—SA
usha sri latha 25-Sep-13 1:04am    
yes compiler does it, means creation of backup fields for automated properties,in the case of properties not.

Is there any other difference

PIEBALDconsult 25-Sep-13 1:16am    
In the immortal words of Bill Murray, "IT JUST DOESN"T MATTER".
Sergey Alexandrovich Kryukov 25-Sep-13 1:22am    
There are no differences. You can write strictly equivalent types with auto-implemented and explicitly implemented property with trivial (no side effect) getter, setter, or both.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900