Friday, November 13, 2015

Default boolean value in Entity Framework

To set a default value to bit column in EF edit the migration file manaully and add defaultvaluesql parameter like

AddColumn("Jobs", "IsAdvertisingRequired", c => c.Boolean(nullable: false, defaultValueSql: "0"));
 
 Reference: http://stackoverflow.com/questions/5567567/default-bool-to-false-when-null-in-database-with-entity-framework-4-1-code-first

No comments:

SSL Error - The connection for this site is not secure

 After cloning a git repo of dot net framework website and trying to run it all I could see was this error Turns out the fix was to simply e...