Mapping One to One entities, e.g. for User -> Manager

Feb 14, 2013 at 4:38 PM
Hi, first of all I just wanted to say WOW what a great resource this is for accessing AD, saves miles of cruddy code and ties in nicely with other EF/LINQ code in my solution.

So what I wanted to know was how to map One to One AD entities like a users manager?

First I tried this :
[DirectoryType("User", "OU=InternalUsers")]
public class User : UserEntryObject
{
    [DirectoryProperty("manager")]
    public string Manager { get; set; }
}
But the result was just an AD string like this:
"CN=Fred\\, Smith,OU=IT Management,OU=IT Global,OU=Users,OU=London,OU=Europe,OU=International,DC=FredSmithLtd,DC=com"
I also thought about declaring the Manager property as a UserEntryObject, but again couldn't work out how to actually create it?
[DirectoryType("User", "OU=InternalUsers")]
public class User : UserEntryObject
{
    [DirectoryProperty("manager")]
    public UserEntryObject Manager
    {
        get { return ???; }
    }
}
Coordinator
Mar 20, 2013 at 12:51 AM
Hi DNH,

Thanks, I'm glad you find it useful! Currently, the framework doesn't support properties being complex mappings. I haven't seen a need for it until now. I can see if I can fit it into the next release or if you wanted to submit an update for it? I'd definitely be willing to work with you on adding this feature.

Thanks,
Stephen Baker
Coordinator
Mar 20, 2013 at 12:54 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.