Exemple #1
0
        public async Task <IActionResult> PutTable1(string id, Table1 table1)
        {
            if (id != table1.Test1)
            {
                return(BadRequest());
            }

            _context.Entry(table1).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Table1Exists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemple #2
0
 public IEnumerable <Users> AddUser(Users us)
 {
     _context.Users.Add(us);
     _context.SaveChangesAsync();
     return(_users.WithoutPasswords());
 }