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

  • Home
  • SEARCH
  • 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 9116817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:45:50+00:00 2026-06-17T04:45:50+00:00

I am trying to use Model first Entity Framework in MVC4. Would like to

  • 0

I am trying to use Model first Entity Framework in MVC4. Would like to disable the creation of some properties in the entity model, these properties only suppose to be used as a viewModel. And I will populate the model properties in the controller dynamically.

May I know what annotation attribute I should put for these properties?

If this cannot be done, then I must create a separated ViewModel to do this. However, the view model will still have other properties linked with the entity model, what is the best way to map them together? 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-06-17T04:45:52+00:00Added an answer on June 17, 2026 at 4:45 am

    Entity framework designer creates model of persisted entities. All properties added through this designer are persisted. The designer creates partial class for every modeled entity. If you want to have additional non-persisted properties available for your views you can either create your own partial part of the class for an entity with only non-persisted properties (persisted properties are already part of the autogenerated part) or you can create specialized view model with all properties you need.

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

Sidebar

Related Questions

I'm trying to use Entity Framework 5 Code First. I've created model classes and
I'm trying to use Entity Framework for my model/data access, and running into speed
I am trying to use MVC3 with the Entity framework with Code First, but
I'm trying to use the Entity Framework code first without an existing database. I
I'm trying to use the entity framework to take data (nested relationships) from one
I am trying to use ADO.Net Codefirst feature of latest Entity Framework 4.0. As
I am using Entity framework Code First CTP5 and I am trying to find
I'm new to Entity Framework and am trying to learn how to use Code
I'm trying to use ORM for the first time, I've defined the models like
I was trying to use SQLite database using ADO.NET Entity Framework 5 and 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.