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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:02:58+00:00 2026-05-20T18:02:58+00:00

I am new to entity framework and mvc. I am trying to understand what

  • 0

I am new to entity framework and mvc.
I am trying to understand what a Controller should pass to the view.
Should it be the class from Models (MySolution.Models.Story) or the class from the entity framework (MySolution.Story).
The problem is that if I pick the one from entity framework, then the DataTypes and html-helpers are not working correctly. If I pick the class from models, then I can’t convert from the entity class to the model class, for example:

TrendEntities TrendDB = new TrendEntities();
public ActionResult Details(int id) {  
  var Country = TrendDB.Countries.FirstOrDefault(c => c.CountryId ==id);  
  return View(Country);  
}  
  • 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-20T18:02:59+00:00Added an answer on May 20, 2026 at 6:02 pm

    Just use the adp.net entity framework POCO templates to generate. download the template. right click in the entity designer and select “add code generation item” and choose the poco template. Now your objects dont have all of the ‘entity framework baggage’ with them. Proxies are automatically created behind the scenes and you don’t need to do any object mapping.
    You can find this template by adding a new item to visual studio 2010, and searching the online templates from within the add dialog for POCO. The template name is:

    ADO.NET C# POCO Entity Generator

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

Sidebar

Related Questions

I'm trying out the new scaffolding features in MVC 3, using Entity Framework Code
I'm trying to return new data to jTable from my entity framework db context.
I created a new MVC application and added an Entity Framework model generated from
The goal: I'm trying to use the new Entity Framework 4.1 DbContext API (using
i'm new in asp.net mvc 2. I'm trying to list all data from one
I'm pretty new to MVC 2 using the Entity Framework. I have two tables
I need help with trying to insert a record using MVC and Entity Framework.
I'm new to Entity Framework. I've created a Multi Tier Application, in MVC, using
I am trying to deploy an ASP.NET MVC 4 application with Entity Framework 4.4
I'm working in asp.net mvc 4 with Entity Framework 5 (with edmx). I'm trying

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.