You can set "StoredGeneratedProperty" attribute of table column in the EDMX file to Computed to enable default value insertion in entity framework.
While working with Entity Framework, you would have noticed that it does not insert default value into the database. You need to manually set values for those properties which have already a default value set in database table. This seems as an extra work to set values for default columns. Suppose, you are saving created date of a row in your table and for this you are using default constraint as today's days. Now when you insert a new record in database, it works absolutely fine but if you perform this operation using entity framework, it will not let you doing so. To insert default value, you need to manually assign a value to that column.
If you are using code first approach, you can set default values using [DefaultValue()] attribute or if you are using database first and using edmx file then you can set StoreGeneratedPattern = "Computed" of that particular column. Just follow the steps below.
Step 1: Open EDMX file and locate your table in that file.
Step 2: Select the property name. Right click and click on property.
Step 3: You will find a property named as StoreGeneratedPattern with value set as None.
Step 4: Set StoreGeneratedPattern = "Computed".
And you are done. Now you can insert default values using EF. Hope this helps you. Pleas like and rate the article. You can comment your views below.