Session: How to get entity url?
GetDocumentUrl is a method in
Advanced session operations that returns full url for a given entity.
string GetDocumentUrl(object entity);
|entity||object||Instance of an entity for which url will be returned.|
|string||Full url for a given
Employee employee = session.Load<Employee>("employees/1"); // http://localhost:8080/databases/Northwind/docs/employees/1 string url = session.Advanced.GetDocumentUrl(employee);
If the entity is transient (not attached) this method will throw