title: How do i declare a field on a table with the datatype of Medium Blob in EF Code First
body: <p>Im using dotnet Core EntityFramework using SapientGuardian.EntityFrameworkCore.MySql</p>
  
  <p>I have a database Entity with a property called ProfileImage stored as a <code>byte[]</code> ... extract below </p>
  
  <pre><code>public class ProfileEntity
  {
  
      /// Gets or sets the full name.
      /// &lt;/summary&gt;
      public string FullName { get; set; }
  
      /// &lt;summary&gt;
      /// A Byte Array with the profile image Bitmap
      /// &lt;/summary&gt;
      public byte[] ProfileImage { get; set; }
  }
  </code></pre>
  
  <p>When this get created in the MySql Database it creates a BLOB DataType.</p>
  
  <p>My Question is how can set it to be a MediumBlob?</p>
  
  <p><strong>Edit:</strong>
  The Migration (which I forgot to run) produced the following:</p>
  
  <pre><code>public partial class AddMediumBlob : Migration
  {
      protected override void Up(MigrationBuilder migrationBuilder)
      {
          migrationBuilder.AlterColumn&lt;byte[]&gt;(
              name: "ProfileImage",
              table: "ProfileEntity",
              type: "MediumBlob",
              nullable: true,
              oldClrType: typeof(byte[]),
              oldNullable: true);
      }
  
      protected override void Down(MigrationBuilder migrationBuilder)
      {
          migrationBuilder.AlterColumn&lt;byte[]&gt;(
              name: "ProfileImage",
              table: "ProfileEntity",
              nullable: true,
              oldClrType: typeof(byte[]),
              oldType: "MediumBlob",
              oldNullable: true);
      }
  }
  </code></pre>