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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:16:18+00:00 2026-05-23T08:16:18+00:00

I am Working on Entity framework to get started with it. Below is the

  • 0

I am Working on Entity framework to get started with it. Below is the way i have arranged my projects to interact with EF. I just want to know if i am heading to the right direction or not. Please do suggest the better approach. Please ignore the architecture things like UI should not have reference to DAL. This is just “get to know” project. 🙂

This is what i am doing:

One project for DAL. Here all the DB operations will be doing using EF.

Model – Business Entity classes. Instead of returning Order object of EF, i will be returning Entity Class of Model. (Is there a way to map my Business Entities to EF entity?)

UI – This will call DAL and get things done.

Project 1 – DAL

This project also contains my edmx file.

public class DALRepository
{

    OrderEntities orderEntitiesContext = new OrderEntities();

    public IQueryable<Model.OrderModel> GetOrders ()
    {
        return orderEntitiesContext.Orders.Select(o => new Model.OrderModel { OrderName = o.OrderName, Id = o.OrderID });
    }
}

Project 2 – Model

public class OrderModel
{
    public long Id { get; set; }
    public string OrderName { get; set; }
}

Project 3 – UI

public partial class OrderList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DAL.DALRepository dal = new DAL.DALRepository();
        GridView1.DataSource = dal.GetOrders();
        GridView1.DataBind();
    }
}
  • 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-23T08:16:19+00:00Added an answer on May 23, 2026 at 8:16 am

    Consider adding an interfaces project with the API needed outside the DAL to enable unit testing without the DAL and a implementation project that implements those interfaces using the DAL project.

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

Sidebar

Related Questions

Can someone tell me how can I get MS Entity Framework working with PostgreSQL.
I have co-workers working on an Entity Framework model that changes structure (entities), over
I think I should mention I'm trying to get Entity Framework\SQL server to do
Trying to get a handle on Entity Framework here and I am hitting some
I am using Entity Framework in an application i am working on, however when
I'm trying to get server-side validation of an Entity Framework String Property to work.
I am working with VS 2010, Entity framework, SQl-Server 2005, ASP.Net web forms .
I am working in ASP.Net MVC 1.0 and SQL Server 2000 using Entity Framework.
Working on a project at the moment and we have to implement soft deletion
Being new to the Entity Framework, I'm really rather stuck on how to proceed

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.