How to find the type of a property, particularly between simple and
collection types?
I am using MVC3, C#, Razor, .NET4, EF5, SQL Server 2008.
I need to find out what the types of a property is on a domain object,
particularly whether it is a ICollection ie Navigation Property or a
simple POCO type ie int, string etc.
Basically I am mapping from a View to a Domain object, and I need to
exclude the navigation properties (ICollection). I am using Value Injector
and I can write a custom injector to ignore ICollection.
There is the "TypeOf" function I believe.
So my pseudo logic would be along the lines of:
Match if not(typeOf(ICollection))
Many thanks.
No comments:
Post a Comment