Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

ObjectQuery by reflection

$
0
0

Hello guys!

   I'm trying to do something like this with reflection and no luck...

this.EFMODELINSTANCE.Entry((PERSON)instance).Collection(d => d.somePersonProperty).Query().Count();

what i'm trying to achieve is getting the count of the navigation property items in an property like

Person -> Address

I want to count all the addresses for an instance of a Person.

So, i want to make a generic method that receives Object (an instance of EF) and a string with the name of the property to count.

Can you help me on this? :)

Thanks in advance!


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>