Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

MVC 5 + EF 6 + MySQL Connector/NET 6.9.6 and TIMESTAMP (2 replies)

$
0
0
Hi guys,

I have a mySql db build by someone. A table has a colum defined as nullable timestamp.

I map it to my entity as

[Column(TypeName = "timestamp")]
[DatabaseGenerated(DatabaseGeneratedOption.None)]
public DateTime? MYCOL{ get; set; }

and Migrations translate this in

AlterColumn("dbo.locusrchkin", "MYCOL", c => c.DateTime(precision: 0, storeType: "timestamp"));

Running Update-Database I receive the error "Invalid default value for 'MYCOL'" because it runs

alter table `MYTABLE` modify `MYCOL` timestamp

How con I map a nullable timestamp in my POCO entity ??? It drive me crazy!

TY.

Viewing all articles
Browse latest Browse all 1447


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>