示例#1
0
        public async Task Handle(CollectionUpdated notification)
        {
            using (var session = await _api.StartSession().ConfigureAwait(false)) {
                await FetchCollectionAndConvert(notification.CollectionId).ConfigureAwait(false);

                await session.Close().ConfigureAwait(false);
            }
        }
示例#2
0
 public override TResponseData Send <TResponseData>(IRequest <TResponseData> request)
 {
     if (!(request is IRequireApiSession))
     {
         return(base.Send(request));
     }
     using (var scope = _scopeFactory.StartSession().Result) {
         var response = base.Send(request);
         scope.Close().WaitAndUnwrapException();
         return(response);
     }
 }