EF Code First/MVC NotNullAttribute


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /var/www/abel.nu/coding.abel.nu/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

Unfortunately MVC3 doesn’t respect the [Required] attribute’s AllowEmptyStrings property. When using a class both as an MVC model and as an EF Code First entity this is a problem. What if I want to allow empty strings, but not null values in the database? The problem lies in the client side validation performed by MVC3.… Continue reading EF Code First/MVC NotNullAttribute

Update-Database MSI Custom Action

In the Prevent EF Migrations from Creating or Changing the Database post I showed how to prevent the application from automatically creating or updating the database. Instead I want the installation program to do that. With a Web Setup Project for the installation an MSI Custom Action is needed. The actual work of updating the database is done… Continue reading Update-Database MSI Custom Action

Scrum and the Business Implementation

In my latest post in the Scrum series I finalized the picture of the parts required to produce a shippable product. However, the project doesn’t end there. One more step is requried and it is the business implementation of the system. In the consultancy business where I work we develop custom systems for customers, to… Continue reading Scrum and the Business Implementation

Send SmtpClient Mails to Disk

When developing a system that sends mails, often the mails shouldn’t be sent for real when testing. Instead they should be made available for investigation. Fortunately, that functionality is built in with the .NET SmtpClient. There is even no need to change the code. It’s just a matter of configuration. Add the following lines to… Continue reading Send SmtpClient Mails to Disk