-
Notifications
You must be signed in to change notification settings - Fork 10k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request - Reusable razor component without polymorphism #24352
Comments
Thanks for contacting us. This seems to be the same as #7268. Can you please confirm whether we got this right? |
@mkArtakMSFT This case is different - it doesn't have a child component or templated component. I basically hoped for a way to pass in a type, e.g. I could be missing how #7268 could help, though. |
Thanks for additional details. It's not still clear then what you're looking for. |
@mkArtakMSFT Thanks for your consideration. I will go with another approach for this and close this out. |
What problem are you trying to solve?
Here is a simplified version of what I am trying to solve.
I am working on a razor component that uses a
<select>
to choose the value of a property on a tracked entity.I have a base
Dropdown
class and multiple classes that derive from it, e.g.Color
, which is a property on the tracked entity.To make the razor component generic enough, I pass in a
List<Dropdown>
created from aList<Color>
.After the
<select>
is changed, I want to assign the new choice to theColor
on the tracked entity.There is no way I can find to set the
Color
property directly - razor component doesn't know it's aColor
and no way to create aColor
object using its type and the values from theList<Dropdown>
corresponding to<select>
value.Without polymorphism support, is there a way it can be accomplished, or is it a current limitation?
Describe the solution you'd like
This is an idea:
The text was updated successfully, but these errors were encountered: