I changed the data type of a field in my model from string to byte array and I got this error when I run Update-Database code first migration method.
Implicit conversion from data type nvarchar(max) to varbinary(max) is not allowed. Use the CONVERT function to run this query.
public override void Up()
{
AlterColumn("dbo.ApplicantLogins", "Photograph", c => c.Binary(nullable: false));
}
public override void Down()
{
AlterColumn("dbo.ApplicantLogins", "Photograph", c => c.String(nullable: false));
}
Sachin SinghPosted Jan 16, 2023, 7:20 PM
paste below code inside up method