We have seen transactions within a single context so far. Let's now explore how transactions could be maintained between different data contexts. We still have only one data context in the blogging system; let's introduce file upload functionality that will be maintained in a different database, thereby requiring us to create a different data context.
Creating a cross-context transaction
File upload support to the blogging system
The file upload functionality will be introduced in the Posts section, where we could upload an image against a post. To start with, let's create a File type, which is inherited from IFormFile. It will be used as a base type while uploading the file content to the controller action...