1
Vote

Add Object Error

description

{"The type or property must have the Attribute: 'System.DirectoryServices.Linq.Attributes.DirectoryTypeAttribute'."}

Here is my code:

var group = new Group();
group.Name = "TestGroup";
context.AddObject(group);
context.SubmitChanges();

[DirectoryType("group")]
    public class Group : EntryObject
    {
        [DirectoryProperty("samaccountname")]
        public string Name { get; set; }

        [EntryCollectionProperty("memberOf", MatchingRule = MatchingRuleType.InChain)]
        public EntryCollection<User> Users
        {
            get
            {
                return ((IEntryWithRelationships)this).RelationshipManager.GetEntryCollection<User>("Users");
            }
        }
    }
I am not sure how to fix this

comments

aday wrote Mar 10, 2015 at 3:30 PM

sorry I meant to add this to the discussions area... I am going to add it there not sure how to delete this one