Esempio n. 1
0
        public async Task <bool> PutLookUpType(int id, LookUpType updatedLookUpType)
        {
            if (updatedLookUpType != null)
            {
                lookUpDbContext.Entry(updatedLookUpType).State = EntityState.Modified;

                try
                {
                    await lookUpDbContext.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LookUpTypeExists(id))
                    {
                        return(false);
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            return(true);
        }
        public async Task <bool> PutCascadingLookUp(int id, CascadingLookUp cascadingLookUp)
        {
            lookUpDbContext.Entry(cascadingLookUp).State = EntityState.Modified;

            try
            {
                await lookUpDbContext.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CascadingLookUpExists(id))
                {
                    return(false);
                }
                else
                {
                    throw;
                }
            }

            return(true);
        }