Actually, this is the best suggestion based on how an entity should work. What James is asking for is a different entity.
BTW, James, I think your entities are not named well. this.o* is a hold over from VFP. You shouldn't use Hungarian notation in .NET. Also, EVERYTHING is an object in .NET, so .o isn't necessary. Additionally, .oEFObject doesn't tell you anything about what entity you're working with. Names should specify what they are. Something like DirectoryEntity may make better sense. Keep in mind I'm just looking at the tiny bit of code you posted. You may want to read the Microsoft Framework Design Guidelines for help with naming, design, etc. You can buy the
book or
read it online.
>I guess this is really an EF question then - I think something similar came up on another thread here recently.
>There may be a more eloquent way but, TBH, I'd go for a relatively 'quick-n-dirty' solution:
>In the EDMX designer copy and paste the current Directories object, rename it, knock out the fields you do not want surfaced in the getDirectory() method and then use that version instead.
>
>Can't say I'm thrilled with this suggestion - but it works :-}
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer