Getting a System.Type from InputMember

2 views
Skip to first unread message

trul...@googlemail.com

unread,
Feb 11, 2010, 4:02:02 PM2/11/10
to OpenRasta
This is probably obvious and i'm just missing the intellisense
option..

public override bool BeforeExecute(IOperation operation)
{
InputMember inputMember = operation.Inputs.FirstOrDefault();


How do I get a System.Type of the type of the input member?

`inputMember.Member.Type.Name` is not fully qualified, so I can't do
`Type.GetType()` on it :(

this works:

(inputMember.Member.Type as
OpenRasta.TypeSystem.ReflectionBased.ReflectionBasedType).NativeType

but thats a nasty casty :(

What should I be doing?

Thanks!

Andrew

SerialSeb

unread,
Feb 12, 2010, 9:04:36 AM2/12/10
to OpenRasta
- Doc, it hurts when i do that
- Don't do that then.

Types are complicated beasts in OpenRasta. What do you need the
qualified type name for? Chances are, you'll end up with not the type
you think of, because of the surrogated type system.

If you really really really need the Type info on an IType, try and
cast it to INativeType instead, that's where the Type property is.

If you're using it as some kind of key somewhere, the IType instances
are guaranteed to be unique, so you can simply use that.

If you're trying to do voodoo with types, you may breach why we have
the abstraction to start with, aka we don't want to make assumptions
on how types work.

On Feb 11, 9:02 pm, "trull...@googlemail.com"

Reply all
Reply to author
Forward
0 new messages