コード例 #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);
        }