/// <returns>An enumeration of the (id, item) pairs. Returns null if no items are present</returns> protected virtual List <T> OnGetItems() { if (string.IsNullOrEmpty(m_winTabName)) { m_winTabName = Feng.Server.Utils.ServiceHelper.GetWindowTabNameFromAddress(WebOperationContext.Current.IncomingRequest.UriTemplateMatch.BaseUri.LocalPath); } var r = DataSearchViewService.InternalGetItems(m_winTabName, WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters); if (r == null) { return(null); } List <T> items = new List <T>(); foreach (Dictionary <string, object> i in r) { T item = Feng.Utils.ReflectionHelper.CreateInstanceFromType(typeof(T)) as T; foreach (KeyValuePair <string, object> kvp in i) { EntityScript.SetPropertyValue(item, kvp.Key, kvp.Value); } items.Add(item); } return(items); }
protected virtual int OnGetItemCount() { if (string.IsNullOrEmpty(m_winTabName)) { m_winTabName = Feng.Server.Utils.ServiceHelper.GetWindowTabNameFromAddress(WebOperationContext.Current.IncomingRequest.UriTemplateMatch.BaseUri.LocalPath); } return(DataSearchViewService.InternalGetItemCount(m_winTabName, WebOperationContext.Current.IncomingRequest.UriTemplateMatch.QueryParameters)); }