Exemplo n.º 1
0
        public NotificationCountersServiceResponse GetCounters()
        {
            var response       = new NotificationCountersServiceResponse();
            var currentContact = UserConnection.CurrentUser.ContactId;
            INotificationCounterFactory factory = ClassFactory
                                                  .Get <INotificationCounterFactory>(new ConstructorArgument("userConnection", UserConnection));
            INotificationCountHandler handler = ClassFactory
                                                .Get <INotificationCountHandler>(new ConstructorArgument("factory", factory));

            try {
                IDictionary <string, int> counters =
                    handler.GetNotificationCounters(currentContact, NotificationGroupConst.All);
                response.NotificationCounters = counters;
            }
            catch (Exception ex) {
                response.Exception = ex;
            }
            return(response);
        }
Exemplo n.º 2
0
 public NotificationCountHandler(INotificationCounterFactory factory)
 {
     factory.CheckArgumentNull(nameof(factory));
     _factory = factory;
 }