private static Task <PaginatedDocuments <T> > PlatformListAsync <T>(string partition, ReadOptions readOptions)
        {
            var taskCompletionSource = new TaskCompletionSource <PaginatedDocuments <T> >();

            MSData.List(new Class(typeof(MSDictionaryDocument)), partition, readOptions.ToMSReadOptions(), resultPages =>
            {
                if (resultPages.CurrentPage().Error == null)
                {
                    taskCompletionSource.SetResult(resultPages.ToPaginatedDocuments <T>());
                }
                else
                {
                    taskCompletionSource.SetException(resultPages.CurrentPage().Error.ToDataException());
                }
            });
            return(taskCompletionSource.Task);
        }
Esempio n. 2
0
 public static AndroidReadOptions ToAndroidReadOptions(this ReadOptions readOptions)
 {
     return(new AndroidReadOptions((int)readOptions.DeviceTimeToLive.TotalSeconds));
 }
        private static Task <DocumentWrapper <T> > PlatformReadAsync <T>(string documentId, string partition, ReadOptions readOptions)
        {
            var taskCompletionSource = new TaskCompletionSource <DocumentWrapper <T> >();
            var msReadOptions        = readOptions.ToMSReadOptions();

            MSData.Read(documentId, new Class(typeof(MSDictionaryDocument)), partition, msReadOptions, resultDoc =>
            {
                ProcessResult(resultDoc, taskCompletionSource);
            });
            return(taskCompletionSource.Task);
        }
Esempio n. 4
0
 private static Task <DocumentWrapper <T> > PlatformReadAsync <T>(string documentId, string partition, ReadOptions readOptions)
 {
     return(GenerateFailedTask <DocumentWrapper <T> >());
 }