Solution to: "The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value" with Entity Framework when calling SaveChanges
1 min read
Go into your EDMX file, select the field that is causing the error and set StoreGeneratedPattern to Computed.

Add the DatabaseGenerated attribute if you are using EF Code First:
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]public Nullable<System.DateTime> Created { get; set; } Share:
Share on LinkedIn
Quick Share: Your custom post text has been copied to your clipboard! Click the button below to open LinkedIn's share dialog, then paste it.
💡 Tip: LinkedIn will open in a new tab. Use Ctrl+V (or Cmd+V on Mac) to paste your text.
Note: LinkedIn will show the article preview. You can add your custom text above it.