private bool GetIdAsString(object entity, object value, out string id) { id = value as string; if (id == null && value != null) // need conversion { id = conventions.FindFullDocumentKeyFromNonStringIdentifier(value, entity.GetType(), true); } return(id != null); }