public async Task <TEntity> Create(TEntity entity) { Context.Add(entity); await Context.SaveChangesAsync(); return(await GetById(entity.Id)); }
public static void LogGravacao(LogEntity log) { using (var db = new BWContext()) { try { db.Add(log); db.SaveChanges(); } catch (Exception e) { throw new Exception(e.Message); } } }