You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 5.2 version.
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