public static Uri GetObjectUri(this ODataObject oDataObject, bool useStreamId = false) { if (useStreamId && oDataObject is Item) { var item = oDataObject as Item; if (!string.IsNullOrEmpty(item.StreamID)) { if (oDataObject.url != null) { return(new Uri(oDataObject.url.ToString().Replace(item.Id, item.StreamID))); } return(oDataObject.ComposeUri((oDataObject as Item).StreamID)); } } if (oDataObject.url == null) { oDataObject.url = oDataObject.ComposeUri((oDataObject).Id); } return(oDataObject.url); }
public static void ComposeUri(this ODataObject oDataObject) { oDataObject.ComposeUri(oDataObject.Id); }