Following are the drawbacks/issues of ADO .NET Entity Framework (VS2008/3.5 SP1) which i encountered so far…
- The Update Model Wizard overwrites the existing storage model when updating the EDM based on database changes. This means that any custom changes you made to the storage model will not be reflected in the updated model. So if you have any custom entities, make a backup of the existing EDM file before doing the update from database. For this same reason i always work on XML notation rather than in designer. This is very frustrating especially if you have huge model with all custom tables, views and Stored Procedures.
- Entity model always enforces to use propertyref key, if you have not specified one, it throws an error “EntityType ‘… ‘ has no key defined”. So always you have to define ref key and the key column must not be a null value column, this is true even for Views as well.
- Should be very careful in setting the ref keys, if they are not properly set the LINQ queries against the entity object may not work properly especially if queries have orderby clause. Make sure the ref keys have unique output especially when you are using Views and the designer creates some sort of default Ref Keys and they may not be unique.
- If you are trying to modify the key column, entity model throws an error message “XXX is part of the object’s key information and cannot be modified.” This does makes sense but not in some situations especially if the key column consists of multiple columns and you want to update the value of one of the column eventually it wouldn’t. To overcome this remove the column that you would like to be on update from object’s key.
- I often get the error “The number of members in the conceptual type ‘XXX’ does not match with the number of members on the object side type ‘XXX’. Make sure the number of members are the same.” when i edit the entity model (edmx) file using xml editor. This means that the designer and xml are not in sync, after the edits in xml file just open the edmx in entity designer and move stuff around and save it. Error gone…
- No support for Batch Updates, only one command per action. Also no support for DML statements using EntityCommand object
Advertisement