Esempio n. 1
0
        public async Task <RetrospectorUser> UpdateAsync(RetrospectorUser user)
        {
            _context.Users.Update(user);
            await _context.SaveChangesAsync();

            return(user);
        }
        public async Task <Team> CreateTeamAsync(Team team)
        {
            await _context.Teams.AddAsync(team);

            await _context.SaveChangesAsync();

            return(team);
        }
Esempio n. 3
0
        public async Task <RetroGame> CreateRetroGameAsync(string name, string template, int teamId)
        {
            RetroGame game = await _context.RetroGames.FirstOrDefaultAsync(rg => rg.Name == name && rg.TeamId == teamId);

            if (game != null)
            {
                return(null);
            }

            var newGame = new RetroGame()
            {
                Name         = name,
                Template     = template,
                CreationDate = DateTime.Now,
                LastModified = DateTime.Now,
                Notes        = new List <Note>(),
                TeamId       = teamId,
                Url          = Guid.NewGuid().ToString()
            };

            _context.RetroGames.Add(newGame);
            await _context.SaveChangesAsync();

            return(await _context.RetroGames.FirstOrDefaultAsync(rg => rg.Name == name));
        }