This project is read-only.

Update

Updating an entry can be accomplished either with a mapped class or the DirectoryAttributes class.
Mapped
Mapped classes can optionally implement IDirectoryObject or subclass DirectoryObjectBase. This introduces support for self tracking serializable entries. If you bypass using the interface or the superclass every updateable property (not read only, distinguished name, or store generated) will be considered for update.

var role = context.Query<Role>()
     .Single(r => r.CommonName == "Test Role");

role.Member.Remove("CN=Test User,CN=Users,DC=example,DC=com");

context.Update(role);
Directory Attributes
var role = context.Query("DC=example,DC=com")
     .Single(da => Filter.Equal(da, "cn", "Test Role"));

var members = new List<string>(role.GetStrings("member"));
members.Remove("CN=Test User,CN=Users,DC=example,DC=com");

role.Set("member", members);

context.Update(role);

Last edited Jun 14, 2012 at 7:05 AM by MadHatter22, version 1