public async Task <Round> CreateRound(Round round) { _context.Rounds.Add(round); await _context.SaveChangesAsync(); return(round); }
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); } }
public async Task <ActionResult <int> > Addusers(Users s) { db.Users.Add(s); return(await db.SaveChangesAsync()); }