simsenVejle
Well-known member
- Joined
- Feb 14, 2021
- Messages
- 46
- Programming Experience
- Beginner
I have 2 models
CategoryModel
---CategoryId
---CategoryName
---ProjectId (this i foreign key)
ProjectModel
---ProjectId
---ProjectName
Those I don't have problems in making.
But now it gets tricky to me. What to do in the VM and also in the View.
In the View I have a ListView where the columns are
---CategoryId
---CategoryName
---ProjectName
Right now I have made a 4. entry in the Category that says ProjectName (and there I have made a join in the stored procedure to the 2 tables. But I think that is very bad. Because the ProjectName shouldn't be in the Category Model.
I have looked on google for the hole day and can't find a tutorial that shows me, how to join the 2 models in the viewmodel and if that isn't the right way how the to make the ListView.
I'm properbly using the wrong sentence in google search.
I would be glad for any kind of help.
Best regards
Simsen
CategoryModel
---CategoryId
---CategoryName
---ProjectId (this i foreign key)
ProjectModel
---ProjectId
---ProjectName
Those I don't have problems in making.
But now it gets tricky to me. What to do in the VM and also in the View.
In the View I have a ListView where the columns are
---CategoryId
---CategoryName
---ProjectName
Right now I have made a 4. entry in the Category that says ProjectName (and there I have made a join in the stored procedure to the 2 tables. But I think that is very bad. Because the ProjectName shouldn't be in the Category Model.
I have looked on google for the hole day and can't find a tutorial that shows me, how to join the 2 models in the viewmodel and if that isn't the right way how the to make the ListView.
I'm properbly using the wrong sentence in google search.
I would be glad for any kind of help.
Best regards
Simsen