Geeks With Blogs
Dane Morgridge Programmer, Geek, ASPInsider
A blog about code and data access
December 2010 Entries
EF4 Code First Control Unicode and Decimal Precision, Scale with Attributes
There are several attributes available when using code first with the Entity Framework 4 CTP5 Code First option. When working with strings you can use [MaxLength(length)] to control the length and [Required] will work on all properties. But there are a few things missing. By default all string will be created using unicode so you will get nvarchar instead of varchar. You can change this using the fluent API or you can create an attribute to make the change. If you have a lot of properties, the attribute ......

Posted On Monday, December 20, 2010 10:00 AM

EF4 CPT5 Code First Remove Cascading Deletes
I have been using EF4 CTP5 with code first and I really like the new code. One issue I was having however, was cascading deletes is on by default. This may come as a surprise as using Entity Framework with anything but code first, this is not the case. I ran into an exception with some one-to-many relationships I had: Introducing FOREIGN KEY constraint 'ProjectAuthorization_UserP... on table 'ProjectAuthorizations' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON ......

Posted On Friday, December 17, 2010 1:50 PM

Copyright © Dane Morgridge | Powered by: GeeksWithBlogs.net | Join free