Ejemplo n.º 1
0
        public async Task <bool> RemoveAsync(Guid id)
        {
            try
            {
                var userToRemove = await _context.User.SingleOrDefaultAsync(u => u.SubjectId == id);

                _context.Remove(userToRemove);
                await _context.SaveChangesAsync();

                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
 public async Task <int> Remove <T>(Guid id) where T : BaseEntity
 {
     _dbContext.Remove(_dbContext.Set <T>().Find(id));
     return(dbContextTransaction == null ? await CommitTrans() : 0);
 }