This question is locked. New answers and comments are not allowed.
Hi,
I wonder how to build tree-like structures with the visual designer. I've did this before using old forward-mapping, but have no luck with the visual designer so far. Here's an example of the table and class I'd created with forward-mapping:
dbo.treeitem
->Id
->name
->parentId
class TreeItem
{
string Name
TreeItem Parent
}
If I move the table to the visual designer, parentId of course is an Int32 (as the table-field is Int32), but it should map to the class' type in code instead.
Edit: I've found the solution! I removed the mapping, added a constraint (parentId->Id) under model scheme and mapped the table again. Now the visual designer shows a Parent:TreeItem and a Treeitems-Collection of children.
Best Regards
Stefan
I wonder how to build tree-like structures with the visual designer. I've did this before using old forward-mapping, but have no luck with the visual designer so far. Here's an example of the table and class I'd created with forward-mapping:
dbo.treeitem
->Id
->name
->parentId
class TreeItem
{
string Name
TreeItem Parent
}
If I move the table to the visual designer, parentId of course is an Int32 (as the table-field is Int32), but it should map to the class' type in code instead.
Edit: I've found the solution! I removed the mapping, added a constraint (parentId->Id) under model scheme and mapped the table again. Now the visual designer shows a Parent:TreeItem and a Treeitems-Collection of children.
Best Regards
Stefan