User1034446946 posted
Hi
I have a complex data entity, and i am using a static method to determine the type in the method i use
var expression = a => a.DateAdded
var unaryExpression = expression.Body as UnaryExpression;
var propertyExpression = (MemberExpression)unaryExpression.Operand;
then i do
if (propertyExpression.Type == typeof(DateTime))
and everything is fine.
However if the expression used a navigated models field, it fails, eg
var expression = a => a.Parent.DateAdded
Is there a way I can just get the last type and not the whole thing
Any suggestions would be appriciated.