Beispiel #1
0
        protected virtual T Save <T>(Action <IRetrievalOptions <T> > options)
            where T : class, IResource, ISaveable <T>
        {
            var optionsInstance = new DefaultRetrievalOptions <T>();

            options(optionsInstance);
            var queryString = optionsInstance.ToString();

            return(this.GetInternalSyncDataStore().Save(this as T, queryString));
        }
Beispiel #2
0
        protected virtual Task <T> SaveAsync <T>(Action <IRetrievalOptions <T> > options, CancellationToken cancellationToken)
            where T : class, IResource, ISaveable <T>
        {
            var optionsInstance = new DefaultRetrievalOptions <T>();

            options(optionsInstance);
            var queryString = optionsInstance.ToString();

            return(this.GetInternalAsyncDataStore().SaveAsync(this as T, queryString, cancellationToken));
        }