I'm working on creating n-tiered application where I will have two separate project
1) project EF (where it will have all my edmx...)
2) project MVC 4 (internet application.)
In my EF i have, I have my .edmx
file and it generate couple of classes with all props as show below (as sample)...
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated from a template.
//
// Manual changes to this file may cause unexpected behavior in your application.
// Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class Requester
{
public int Id { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
<//more...........>
}
everything is good so far!!
Back to MVC project
Now I will be creating a new Controller in my MVC project and when I'm trying to create Scaffolding
and provide the Controller
name and Controller
expects a Model
so the real question is:
What Model
should I be passing here?
should I have the same class that EF created? or should I be creating another Model
in my 'Model Folder` (MVC) and bind it? if yes than am I not creating duplicate property if I go ahead and create my same Model in MVC model Folder project?
What I'm trying to do? : Well my purpose of this exercise is to have my Data Access Layer (DAL) totally separate from MVC project.
any thoughts?