示例#1
0
        public static int IndexOf <TElement>(this DataServiceQuery <TElement> q, FilterParameterCollection keyCondition)
        {
            var query    = q.AddQueryOption("rf.indexof", HttpUtility.UrlEncode(keyCondition.JsonSerialize(), Encoding.GetEncoding(1251)));
            var response = query.Execute() as QueryOperationResponse <TElement>;
            int idx      = -1;

            int.TryParse(response.Headers.FirstOrDefault(h => h.Key == "Index-Of-Model").Value, out idx);
            return(idx);
        }
示例#2
0
 public static DataServiceQuery <TElement> AddFilters <TElement>(this DataServiceQuery <TElement> q, FilterParameterCollection fc)
 {
     return(q.AddQueryOption("rf.filter", HttpUtility.UrlEncode(fc.JsonSerialize(), Encoding.GetEncoding(1251))));
 }