Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8169377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:49:46+00:00 2026-06-06T20:49:46+00:00

Using ASP.NET 4, and Entity framework 4.3.1 via ObjectContext. Anytime I update/refresh the model

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:49:48+00:00Added an answer on June 6, 2026 at 8:49 pm

    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.

    • Database first – you modify your database and run Update model from database to get modifications and related mappings in designer
    • Model first – you modify your model and run Generate database from model to get a SQL script for creating your database

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

From Entity Framework using ASP .NET MVC 3.0, is it possible to use a
I am using ASP.Net / WebForms / Entity Model / Framework 3.5 Here is
When using ASP.NET MVC plus Entity Framework, and trying to implement a generic repository
I am using ASP.NET MVC2 and Entity Framework. I am going to simplify the
I am using the asp.net mvc with the Entity Framework. I have a list
I have asp.net application and am using Entity Framework to connect it with the
i've started working with ASP.NET MVC and using Entity Framework, concretely with SQLite db,
I have an ASP.NET Dynamic Data application (using Entity Framework) in which I have
I have developed an ASP.Net (VB.Net) website which is using Entity Framework and SQL
Using Entity Framework, I suddenly get this strange error after publishing my asp.net mvc

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.