Esempio n. 1
0
        public virtual async Task <ActionResponse> UpdateAsync(TEntity entityToUpdate)
        {
            try
            {
                _dbSet.Attach(entityToUpdate);
                _context.Entry(entityToUpdate).State = EntityState.Modified;
                await _context.SaveChangesAsync();

                return(new ActionResponse());
            }
            catch
            {
                return(ActionResponse.FailedToUpdate());
            }
        }