OpenRasta URI 实现问题
我正在 OpenRasta 中为配置文件中的资源实现 URI。该特定资源是多个资源的子实体。 父母和孩子是一对多的关系。所有父实体都通过代码中的枚举类型拥有 int 值。
现在我想像这样实现我的 URI:
{ParentEntityName}/{ParentId}/{ChildName}/{ChildId}
我该如何实现这个?我是否需要为每个父实体进行单独的配置,还是有动态的方式?
I am implementing URI in OpenRasta for a resource in configuration file. This perticular resource is a child entity of multiple resources.
Parent and child is having one to many relation. All Parent Entities are having an int value via enum type in code.
Now I want to implement my URI like this :
{ParentEntityName}/{ParentId}/{ChildName}/{ChildId}
How can I implement this?? Do I need to make saperate configuration for each parent entity or there is a dynamic way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以有一个处理程序来接受所有这些并以这种方式检索实体。
话
虽如此,如果孩子在服务器上有一个标识符,您只需将 URI 与 id 进行映射,就可以让事情变得更容易。
You can just have a handler that takes all this and retrieve the entity that way.
and
Now that said, if the child has an identifier on the server you can probably make things easier on yourself by just mapping the URI with an id.