Example #1
0
        public async Task Execute(Entities.Contact contact)
        {
            _fileUploadContext.Contact.Update(contact).State = EntityState.Modified;

            int updatedRecordCount;

            try
            {
                updatedRecordCount = await _fileUploadContext.SaveAsync();
            }
            catch (DbUpdateException due)
            {
                // Log
                throw;
            }
        }
        public async Task Execute(Entities.FileUpload fileUpload)
        {
            _fileUploadContext.FileUpload.Add(fileUpload);

            int createdRecordCount;

            try
            {
                createdRecordCount = await _fileUploadContext.SaveAsync();
            }
            catch (DbUpdateException due)
            {
                // Log
                throw;
            }
        }
        public async Task Execute(List <Entities.FileUpload> fileUploads)
        {
            foreach (var fu in fileUploads)
            {
                _fileUploadContext.FileUpload.Update(fu).State = EntityState.Modified;
            }

            int updatedRecordCount;

            try
            {
                updatedRecordCount = await _fileUploadContext.SaveAsync();
            }
            catch (DbUpdateException due)
            {
                // Log
                throw;
            }
        }