Exemplo n.º 1
0
        public object Update(int id, Schedule schedule)
        {
            _medicwallContext.Entry(schedule).State = EntityState.Modified;

            try
            {
                _medicwallContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Exists(id))
                {
                    return(null);
                }
                else
                {
                    throw;
                }
            }

            return(schedule);
        }
Exemplo n.º 2
0
        public async Task <User> Update(int id, object obj)
        {
            _medicwallContext.Entry(obj).State = EntityState.Modified;

            try
            {
                await _medicwallContext.SaveChangesAsync();
            }
            catch
            {
                throw;
            }

            return(await Get(id));
        }