Example #1
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }
            fileuploadVM.file     = files.FirstOrDefault();
            fileuploadVM.FileName = files.FirstOrDefault().FileName;
            fileuploadVM.fileSize = files.FirstOrDefault().Length;
            fileuploadVM.Type     = fileuploadVM.Type;
            fileuploadVM.save();

            _context.Attach(fileuploadVM).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FileUploadExists(fileuploadVM.id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./FileUploadIndex"));
        }
Example #2
0
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(FirebaseSetting).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!FirebaseSettingExists(FirebaseSetting.ID))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./firebaseIndex"));
        }