Possible Duplicate:
Giving a property the same name as its class
In working on a solution where I was struggling to "add" properties to a sealed class, someone pointed out that my naming of a property with the same name as a type was asking for trouble.
Here's a snippet of my code:
class BackupFileInfo : IEquatable<BackupFileInfo>
{
public FileInfo FileInfo { get; set; }
}
I would have preferred to just inherit FileInfo
, but I can't since it's sealed. I'd also like to name it FileInfo
(since that's exactly what it is), but want to avoid potential problems later on. I'm trying to avoid silly names like MyFileInfo
, but I'm stumped at how best to name the property of type FileInfo
.
Is there a best practice for naming properties in this situation?