示例#1
0
 private static Task <DocumentWrapper <T> > PlatformReplaceAsync <T>(string documentId, T document, string partition, WriteOptions writeOptions)
 {
     return(GenerateFailedTask <DocumentWrapper <T> >());
 }
示例#2
0
        private static Task <DocumentWrapper <T> > PlatformCreateAsync <T>(string documentId, T document, string partition, WriteOptions writeOptions)
        {
            var taskCompletionSource = new TaskCompletionSource <DocumentWrapper <T> >();
            var msWriteOptions       = writeOptions.ToMSWriteOptions();

            try
            {
                var msDictionaryDocument = document.ToMSDocument();
                MSData.Create(documentId, msDictionaryDocument, partition, msWriteOptions, resultDoc =>
                {
                    ProcessResult(resultDoc, taskCompletionSource);
                });
            }
            catch (NSErrorException e)
            {
                taskCompletionSource.SetException(e);
            }
            return(taskCompletionSource.Task);
        }
示例#3
0
 public static AndroidWriteOptions ToAndroidWriteOptions(this WriteOptions writeOptions)
 {
     return(new AndroidWriteOptions((int)writeOptions.DeviceTimeToLive.TotalSeconds));
 }
示例#4
0
        private static Task <DocumentWrapper <T> > PlatformDeleteAsync <T>(string documentId, string partition, WriteOptions writeOptions)
        {
            var taskCompletionSource = new TaskCompletionSource <DocumentWrapper <T> >();
            var msWriteOptions       = writeOptions.ToMSWriteOptions();

            MSData.Delete(documentId, partition, msWriteOptions, resultDoc =>
            {
                ProcessResult(resultDoc, taskCompletionSource);
            });
            return(taskCompletionSource.Task);
        }