This may help: Blazor Tree Creator with Checkboxes
The NodeName and the IsSelected show how you can add properties to each element.
What this doesn't cover is associating those properties to other elements.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello and thank you for any help you may provide. I have a problem that is in my head for the past week and that I can't resolve and I will appreciate any help in resolving it.
In my head I would like to classify objects by category and sub-category, and have the sub-category have object properties according to the subtype... for example
OBJECT : Motorcycle => have name like "Harley Davidson 500 Street", etc
Category : Automotive > Subcategory : Motorcycle > THEN subcategory has a set of sub-properties like: Engine, Brand, Color, Price,
OBJECT Handbag => have name like "Gucci Guapisima Wherever Edition", etc
Category : Clothing and Apparel > Subcategory : Brand Handbags > THEN subcategory has a set of sub-properties like: Material, Size, Color, Price,
Not the way I see it is... Most of object share the majority of this structure, like all objects have name, all of them belong to a category and a sub-category, now the problem comes on how to setup properties for each sub-category... for example both objects share the Color and Price but not the other properties. How to make this non-hard-coded? in other words, we know some of the properties are shared between objects, how can we do a model like this and then put this into a form?
I could do a dictionary but in the end, how do I validate them in the form?
Thanks for any help you could provide me.
This may help: Blazor Tree Creator with Checkboxes
The NodeName and the IsSelected show how you can add properties to each element.
What this doesn't cover is associating those properties to other elements.
Hi @Guillermo Perez ,
After according to the database normalization/design creates a model, you can refer to the following articles to configure relationships between models:
Relationships
Conventions in Entity Framework Core
Fluent API in Entity Framework Core.
Then, you can refer to Model validation in ASP.NET Core MVC and Razor Pages to do the model validation and refer to the Loading Related Data to load the data.
Best regards,
Dillion