RavenDB 中自动生成的 ID [英] Autogenerated Id in RavenDB

查看:56
本文介绍了RavenDB 中自动生成的 ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请我在 raven DB 插入中使用默认 ID 生成,现在一切似乎都正常

Please I am using the default ID Generation in raven DB inserting and everything seems to work fine for now

但是我的 ID 具有以下格式entityName/1"

However My ID Has the following format "entityName/1"

因此如果添加为路由值,则以下 URL 结果

so if added as a route value, the following URL Results

http://localhost:10563/Settings/Edit/SystemSettings/1

你可以猜出以下消息的结果

Which as u can guess results in the following message

描述:HTTP 404.您要查找的资源(或其依赖项之一)可能已被删除、更改名称或暂时不可用.请检查以下 URL 并确保其拼写正确.

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

请求的 URL:/Settings/Edit/SystemSettings/1

Requested URL: /Settings/Edit/SystemSettings/1

请问我该如何改变这种行为

Please how can I change this behavior

提前致谢

推荐答案

有多种方法可以解决 MVC 路由和 RavenDB 命名约定之间的这种冲突,最简单的方法在这里描述(页面底部):http://ravendb.net/kb/3/using-ravendb-in-an-asp-net-mvc-website

There are multiple ways of solving this conflict between MVC routing and RavenDB's naming conventions, the easiest way is described here (bottom of page): http://ravendb.net/kb/3/using-ravendb-in-an-asp-net-mvc-website

这篇关于RavenDB 中自动生成的 ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆