1

Closed

Select is not translating new expressions

description

Suppose I want to add more info into a LdapUser's property. I would do something like select a new LdapUser expression and add my extra info:
        [TestMethod]
        public void ProjectLdapQueryTest()
        {
            var context1 = new MockDirectoryContext();
            var v1 = context1.Users.Where(w => w.AccountName.Contains("pv")).
                Select(w=>new LdapUser
                {
                    AccountName = w.AccountName, 
                    OtherProperty = "T"
                });
             Assert.AreEqual(v1.First().OtherProperty,"T");
        }
This test fails because OtherProperty is null. This property has not DirectoryProperty attribute, then, somehow it is not projected in the select. Even more, the query is ignoring the select lambda.

Bests
Closed Nov 5, 2013 at 8:34 AM by Karaken12
Duplicate of Issue #11983.

comments

Karaken12 wrote Nov 5, 2013 at 8:36 AM

Thanks for reporting this, Paulovila. We are already aware of this problem; please feel free to add any more details to Issue #11983.

Regards,
Tom

paulovila wrote Nov 5, 2013 at 1:31 PM

Thank you Tom
Bests, Paulo