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 6733203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:44:27+00:00 2026-05-26T10:44:27+00:00

I’m new to ASP.NET MVC 3 with Entity Framework, and I’ve purchased a couple

  • 0

I’m new to ASP.NET MVC 3 with Entity Framework, and I’ve purchased a couple of books around this subject and have researched on this on a number of sites. But, there are still a couple of questions that are un-answered or unclear. Most of the examples from the books, and tutorials on the sites don’t cover end-to-end scenarios, and they cover a basic approach.

The following areas are where I’m quite unclear:

  1. When you create a database first approach, with a normalised schema. How does this translate into the classes ? The steps that I had taken was 1) create the tables, then I added a ADO.NET Entity Data Model. From here, i chose to generate a data model from a database. There was no issues yet, all tables were generated as classes. From there, I selected “Add Code Generation Item” via the right click context menu. I then chose to add ADO.NET DbContext Generator. This create the classes etc.. for my models. From here should i manually edit the class files to produce a 1 to many relationship ?

  2. With the classes that I have generated (see #1) can I manipulate these to ensure that I can add logic within the setting of the attribute (i.e settting a property, I have code with an if statement and if it is true it also updates secondary value. e.g if(myVar != “”){ myChangeVar = currentDate;)

  3. Can I have multiple classes to a table with Entity Framework ? Almost creating different views etc…

Thanks

  • 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-05-26T10:44:28+00:00Added an answer on May 26, 2026 at 10:44 am

    You never ever manually modify any auto generated code – that is key for working with code generators. Any change to EDMX will delete all your changes in generated code because generation tools work in simple approach: delete whole file content and create a new one.

    If you need any special code directly inside generated classes you must

    • Ensure that it is correctly modeled in EDMX (that belongs to your request for one to many relation). EDMX is a key for mapped features. Classes are just sub product.
    • Add custom logic generation to T4 template. DbContext generator is a template producing code files – if you need to generate some additional code which can be generalized you can modify the template.

    You can also need some specific code which is related to some class or some property. In such case:

    • You can use your own partial class to add additional methods or properties. This doesn’t allow modifying generated properties
    • If you require specific logic in mapped properties you should abandon generator approach and write classes completely by yourselves.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.