RavenDB entity Id as string

1/30/2013 11:38:47 AM

Internal RavenDB storage treat entity Id as string like "Posts/12". This conflicts with ASP.NET MVC routing (mind the slash in URLs).

RavenDB feature of  public int Id { get; set; } seems like a win at first but in the end it's a big pain when it comes to more advanced index creations. Do use string as Id, convert it to int for the view models in mvc but let the entity objects use string.

Here's a great post on the subject, http://kijanawoodard.com/just-use-string-id-for-ravendb

Guess this was one of those hour wasting pitfalls one jumps into learning new frameworks.

New day! Lets make things right!