Exemplo n.º 1
0
        public void Handle(InsertKeyboards command)
        {
            var listInsert = GetKeyboards(3);

            foreach (var keyboard in listInsert)
            {
                _context.Add(keyboard);
            }
            _context.SaveChanges();
        }
        public void Handle(SetResult command)
        {
            var user = _context.Users.FirstOrDefault(x => x.Id == command.UserId);

            if (user == null)
            {
                user = CreateGuest(command.UserId.Value);
            }
            _context.Results.Add(new Result(command.IdLesson, command.Errors, command.Ppm, command.Stars, command.Time, user));
            _context.SaveChanges();
        }