Exemplo n.º 1
0
        /// <summary>
        /// Update instance
        /// </summary>
        /// <param name="entity">Instance we want do update</param>
        /// <returns></returns>
        public virtual async Task <bool> UpdateAsync(T entity)
        {
            try
            {
                dbContext.Entry(entity).State = EntityState.Modified;
                await dbContext.SaveChangesAsync();

                return(true);
            }
            catch
            {
                return(false);
            }
        }