Example #1
0
 public Task <Contact?> GetAsync(Guid id)
 {
     return(DataSvcInvoker.Default.InvokeAsync(this, async() =>
     {
         var __result = await _data.GetAsync(id).ConfigureAwait(false);
         return __result;
     }));
 }
Example #2
0
        public Task <Contact?> GetAsync(Guid id)
        {
            return(DataSvcInvoker.Current.InvokeAsync(typeof(ContactDataSvc), async() =>
            {
                var __key = new UniqueKey(id);
                if (_cache.TryGetValue(__key, out Contact __val))
                {
                    return __val;
                }

                var __result = await _data.GetAsync(id).ConfigureAwait(false);
                _cache.SetValue(__key, __result !);
                return __result;
            }));