-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering Entity Framework Core 2.0
By :

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.
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, the following code implementation would provide support for file upload functionality:
public class File : IFormFile { public Guid Id { get; set; } public string ContentType { get; set; } string ContentDisposition { get; set; } public byte[] Content { get; set; } ...