Since I've gone back to a static type, I'm pleased to say this query works perfectly:
var query = context.Query(namingContext, objectClass: "Person") .Where(da => (Filter.Equal(da, "givenname", "Andrew") && Filter.Equal(da, "sn", "Fuller")) || Filter.Equal(da, "cn", "Andrew Fuller")) .Select(da => new { Guid = da.GetGuid("objectguid"), EmployeeId = da.GetInt("employeeid") }); var user = query.FirstOrDefault(); //Produces this filter: (&(objectClass=Person)(|(&(givenname=Andrew)(sn=Fuller))(cn=Andrew Fuller))) Attributes: objectguid, employeeidProjections are supported as well. This will look at the parameters for the Get methods so your anonymous object properties can be called anything.
The Filter class still only supports Equal and Approximately so I'll need to fill it out with the other operations. Happy coding!
No comments:
Post a Comment