Exemplo n.º 1
0
        public virtual async Task Insert(T entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            await entities.AddAsync(entity);

            try
            {
                context.SaveChanges();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 2
0
 public void AddUser(UserService user)
 {
     _context.Add(user);
     _context.SaveChanges();
 }