Using ASP.NET 4, and Entity framework 4.3.1 via ObjectContext.
Anytime I update/refresh the model from the database any property attributes set i.e. [AllowHtml]
over a property in one or more entity class will disappear since the procedure completely rebuilds all the classes for the entity model it seems.
Also when trying to add simple scalar property through the designer the table mappings are not auto created and I can't create them, leaving me the only option of first adding this property to the underlying database and then running the update/refresh model wizard. Is it possible to add the table mappings ? If not why is this function even included in the designer.
The first rule of auto generated code: You must not modify it because your modification will be lost every time the designer will run auto generation again - auto generation is not able to detect your changes. It is responsible for generating a correct code for your current model and because of that it will always create all code from scratch and delete the old code.
The table mappings are not automatically created. Designer supports two modeling approaches.
You should use only one approach.
If you want to mark entities with attributes you must not use auto generated code. You must manually create and maintain your classes. In case of validation (with data annotations) you can use buddy classes instead but it is probably not your case.