Exemplo n.º 1
0
        public async Task <T> AddAsync(T entity)
        {
            await _dbContext.Set <T>().AddAsync(entity);

            await _dbContext.SaveChangesAsync();

            return(entity);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,user,time,issue,area_of_issue,resolution,status")] Ticket ticket)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ticket);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ticket));
        }
Exemplo n.º 3
0
 public async Task <int> SaveAsync()
 {
     return(await _db.SaveChangesAsync());
 }