Just learn’t something today that I’d like to share.
Say you’ve got a generic list of
that you’d like to convert to
where Person : IPerson.
How do you do this? Very simple:
IQueryable<IPerson> iPersons = persons.Cast<IPerson>();
IQueryable<IPerson> iPersons = (IQueryable<IPerson>)persons;
If you download the latest version of Moq, you’ll notice that the Mock
Upon inspection, I discovered that a conditional attribute that was being applied to the method which was causing it to be skipped. I am assuming that attribute was meant to be removed but got overlooked.
Anyways, to fix it, here is what you do:
1. Download the source code for Moq and open up the file Mock.Generic.cs
2. Find the method SetupAllProperties() and remove the conditional attribute:
3. Re-build and overwrite for existing Moq.dll that your project is referencing with the new one.