Esempio n. 1
0
        public async Task <Round> CreateRound(Round round)
        {
            _context.Rounds.Add(round);
            await _context.SaveChangesAsync();

            return(round);
        }
Esempio n. 2
0
        public async Task <T> CreateAsync <T>(T entity) where T : class, IBaseDomain
        {
            try
            {
                await _context.Set <T>().AddAsync(entity);

                await _context.SaveChangesAsync();

                return(entity);
            }
            catch (Exception ex)
            {
                _log.LogError($"Exception Creating entity - {ex.Message}", entity, ex);
                return(null);
            }
        }
Esempio n. 3
0
 public async Task <ActionResult <int> > Addusers(Users s)
 {
     db.Users.Add(s);
     return(await db.SaveChangesAsync());
 }