EF migration can't Alter(change) Datetime(DataType) column to long(bigint)

174 Views Asked by At

I use EF code first approach and altering database by package manager console

Trying to change column invoiceno Datetime to long

Add-migration "message"

Update-Database command returns error

Implicit conversion from data type datetime to bigint is not allowed. Use the CONVERT function to 
run this query.
1

There are 1 best solutions below

0
Baganaakh On

insert before

    [DatabaseGenerated(DatabaseGeneratedOption.None)]