public KeyValuePair <int, byte[]>[] GetItems(GetItemsRequest request)
        {
            Api.JetSetCurrentIndex(session, list, "by_key");
            Api.MakeKey(session, list, request.Key, Encoding.Unicode, MakeKeyGrbit.NewKey);
            if (Api.TrySeek(session, list, SeekGrbit.SeekEQ) == false)
            {
                return(new KeyValuePair <int, byte[]> [0]);
            }

            Api.MakeKey(session, list, request.Key, Encoding.Unicode, MakeKeyGrbit.NewKey);
            Api.JetSetIndexRange(session, list,
                                 SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive);

            var results = new List <KeyValuePair <int, byte[]> >();

            do
            {
                var id    = Api.RetrieveColumnAsInt32(session, list, listColumns["id"]);
                var bytes = Api.RetrieveColumn(session, list, listColumns["data"]);
                results.Add(new KeyValuePair <int, byte[]>(id.Value, bytes));
            } while (Api.TryMoveNext(Session, list));

            return(results.ToArray());
        }
예제 #2
0
 public KeyValuePair<int, byte[]>[] GetItems(GetItemsRequest request)
 {
     throw new NotImplementedException();
 }
        public KeyValuePair<int,byte[]>[] GetItems(GetItemsRequest request)
        {
            Api.JetSetCurrentIndex(session, list, "by_key");
            Api.MakeKey(session, list, request.Key,Encoding.Unicode, MakeKeyGrbit.NewKey);
            if (Api.TrySeek(session, list, SeekGrbit.SeekEQ) == false)
                return new KeyValuePair<int, byte[]>[0];

            Api.MakeKey(session, list, request.Key, Encoding.Unicode, MakeKeyGrbit.NewKey);
            Api.JetSetIndexRange(session, list,
                SetIndexRangeGrbit.RangeUpperLimit | SetIndexRangeGrbit.RangeInclusive);

            var results = new List<KeyValuePair<int, byte[]>>();
            do
            {
                var id = Api.RetrieveColumnAsInt32(session, list, listColumns["id"]);
                var bytes = Api.RetrieveColumn(session, list, listColumns["data"]);
                results.Add(new KeyValuePair<int, byte[]>(id.Value, bytes));
            } while (Api.TryMoveNext(Session, list));

            return results.ToArray();
        }