private static Task <DocumentWrapper <T> > PlatformReplaceAsync <T>(string documentId, T document, string partition, WriteOptions writeOptions) { return(GenerateFailedTask <DocumentWrapper <T> >()); }
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); }
public static AndroidWriteOptions ToAndroidWriteOptions(this WriteOptions writeOptions) { return(new AndroidWriteOptions((int)writeOptions.DeviceTimeToLive.TotalSeconds)); }
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); }