Esempio n. 1
0
        public async Task <IUserQueue> Update(IUserQueue entity)
        {
            TUserQueue tEntity = entity as TUserQueue;

            var errors = await this.ValidateEntityToCheckExistsAtUpdate(tEntity);

            if (errors.Count() > 0)
            {
                await this.ThrowEntityException(errors);
            }

            try
            {
                this.StartTransaction();
                await base.Update(tEntity, x => new
                {
                    x.UserId,
                    x.QueueId
                });

                this.CommitTransaction();
                return(tEntity);
            }
            catch (PostgresException ex)
            {
                throw new EntityUpdateException(ex);
            }
            catch
            {
                throw;
            }
        }
 public QueueLogic(IUserQueue userQueue, ILogger <QueueLogic> logger, IMessageQueueHelperFactory messageQueueHelperFactory)
 {
     _userQueue = userQueue;
     _logger    = logger;
     _messageQueueHelperFactory = messageQueueHelperFactory;
 }
Esempio n. 3
0
 public MessagesController(IUserQueue usersQueue, IMessageQueue messegesQueue)
 {
     _usersQueue    = usersQueue;
     _messegesQueue = messegesQueue;
 }
Esempio n. 4
0
 public void TestInitialize()
 {
     queue = new UserQueue <int>();
 }
 public QueueController(IUserQueue userQueue) =>