protected static ODataEntity GetEntity(StringWriter output) { var result = new Dictionary <string, object>(); var jo = (JObject)Deserialize(output); return(ODataEntity.Create((JObject)jo["d"])); }
public void OData_Children_Entity_SelectChildren_NoExpand() { Test(() => { CreateTestStructure(); var entity = ODataGET <ODataEntity>($"/OData.svc/Root/Sites('{TestSiteName}')", "?metadata=no&$select=Id,Name,Children"); Assert.IsTrue(ODataEntity.Create((JObject)entity.AllProperties["Children"]).IsDeferred); }); }
protected static ODataEntities GetEntities(StringWriter output) { var result = new List <ODataEntity>(); var jo = (JObject)Deserialize(output); var d = (JObject)jo["d"]; var count = d["__count"].Value <int>(); var jarray = (JArray)d["results"]; for (int i = 0; i < jarray.Count; i++) { result.Add(ODataEntity.Create((JObject)jarray[i])); } return(new ODataEntities(result.ToList(), count)); }