Autogenerated Id in RavenDB

风格不统一 提交于 2020-04-15 19:25:13

问题


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

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

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

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.

Requested URL: /Settings/Edit/SystemSettings/1

Please how can I change this behavior

Thanks in advance


回答1:


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



来源:https://stackoverflow.com/questions/19590506/autogenerated-id-in-ravendb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!