I have an entity class as follows
public class Order
{
public long Id { get; set; }
//other properties
[Timestamp]
public byte[] Timestamp { get; set; }
}
I also have the following entry in the DbContext
builder.Entity<Order>()
.Property(c => c.Timestamp).ValueGeneratedOnAddOrUpdate();
But when I try to add a record into the order table I get the following error
Field ‘Timestamp’ doesn’t have a default value
How can I resolve this in ASP.Net 8, C#, Entity Framework Core and MySql