Esempio n. 1
0
        public async Task Handle(SayHelloALot command, IMessageHandlerContext ctx)
        {
            Processed++;
            var user = await _uow.For <User>().Get(command.User);

            user.SayHelloALot(command.Message);
        }
Esempio n. 2
0
        public async Task Handle(SayHelloALot command, IMessageHandlerContext ctx)
        {
            Processed++;
            var user = await _uow.For <User>().TryGet(command.User);

            if (user == null)
            {
                user = await _uow.For <User>().New(command.User);

                user.Create();
            }
            user.SayHelloALot(command.Message);
        }