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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:17:11+00:00 2026-06-16T07:17:11+00:00

Premise: I’m using Entity Framework, Repository Pattern and MVP for an ASP.NET project. Question:

  • 0

Premise: I’m using Entity Framework, Repository Pattern and MVP for an ASP.NET project.

Question: In MVP pattern, how to create a Property of type List<T> in the View, where T is a Data Type generated by Entity Framework?

In the code below, “TeamMember” in List<TeamMember> is a class created by Entity Framework based on the SQL Table TeamMembersTable.
The issue here is I’m creating a List<T> property in my View, where T is a Data Type from my Entity Framework model. This seems to be violating separation of concerns, since the view is now dependent on Data Types from my Model layer. How to accomplish clean separation of View and Model in this scenario?

Note: In case of a simple TextBox, its easy since the data type is a .NET type like String or DataTime. However, if the DataType of property to be created in View is from the model, it seems to make View more tightly coupled with Model as far as data types are concerned.

//***************Simplified Code Sample*******************//
using Model;

namespace View
{
    public interface IEmployeeView
    {
        List<TeamMember> TeamMembers { set; }
    }
}
  • 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-16T07:17:12+00:00Added an answer on June 16, 2026 at 7:17 am

    Introduce a view model which will represent your TeamMember class and pass that into your view instead e.g.

    public class TeamMemberViewModel
    {
        ...
    }
    
    public interface IEmployee
    {
        public List<TeamMemberViewModel> TeamMembers { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Before while my web application was on-premise solution I used standard asp.net chart control
I have made a quick fiddle: http://jsfiddle.net/tLLB4/ Ok, so the premise is, i'm hovering
Premise When using code analysis (or fxCop) with C# optional parameters you can get
I'm trying to create some sort of many-to-one association. The basic premise is a
Premise, it is first time I work with Active Directory (my project is a
I want to premise that this question's purpose is checking if there's at least
Edit: The original premise of the question was incorrect so revised the question: Basically
First let me premise with I am very new to access vba. My question
Thanking you for taking the time to look at this question. The premise of
I'm connecting successfully to on-premise server using the organization service by this code. using

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.