Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

ViewComponentDescriptor.Type should be a TypeInfo instance instead of a Type instance #3952

Closed
javiercn opened this issue Jan 19, 2016 · 3 comments
Assignees
Milestone

Comments

@javiercn
Copy link
Member

ViewComponentDescriptor.Type is of type System.Type while ControllerActionDescriptor.ControllerTypeInfo is of type TypeInfo.

We should change ViewComponentDescriptor.Type to ViewComponentDescriptor.TypeInfo and change the type of the property to be TypeInfo.

In general, TypeInfo represents the information of a type, while Type respresents a type at runtime. We should use TypeInfo through the stack and do AsType where we need an instance of Type.

I'm not sure if there is a scenario where AsType might return null and if we should guard against that.

@Eilon
Copy link
Member

Eilon commented Jan 19, 2016

I doubt we need null checks for this. Please time box the work so we don't spend a lot of time on it.

@rynowak
Copy link
Member

rynowak commented Jan 20, 2016

Agreed, we should be using TypeInfo here and other places. Please look at ParameterDescriptor as well and make sure it's consistent.

I'm not sure if there is a scenario where AsType might return null and if we should guard against that.

This seems excessive 😆

@Eilon
Copy link
Member

Eilon commented Jan 20, 2016

Oh wait a sec I could have swore yesterday that we agreed that Type was the right thing to use and TypeInfo is just an artifact of history. I guess I don't care much either way but this doesn't sound like what we discussed.

javiercn added a commit that referenced this issue Jan 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants