Example #1
0
        public async Task <bool> SaveChangeAsync(FCNDBContext.DataAccessLayer.FCNDBContext context)
        {
            if (context == null)
            {
                return(false);
            }
            try
            {
                int amount = await context.SaveChangesAsync();

                if (amount >= 1)
                {
                    return(true);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }

            return(false);
        }
Example #2
0
        public async Task <bool> UpdateAsync(Files file, FCNDBContext.DataAccessLayer.FCNDBContext context)
        {
            if (context == null)
            {
                return(false);
            }
            context.PDFFiles.Attach(file);
            try
            {
                int amount = await context.SaveChangesAsync();

                if (amount == 1)
                {
                    return(true);
                }
            }
            catch
            {
                return(false);
            }

            return(false);
        }