0
Hi,
The difference between the UserTable.cs and UserInfo.cs, if you used Entity Framework, then UserTable.cs (Same table is exist in DB) will not able to modify. It will contain all the columns of the DB. So if you don't want all the columns and if you like some extra column then you can have UserInfo.cs
Ex. In the DB UserTable contain following fileds
- UserId
- FirstName
- LastName
- Street
- City
- State
- Country
- Status
Now if you want in your application then you can have UserInfo.cs as
- UserId
- Name
- Address
- Status
So it is upto you to have one more DataModel of your type in MVC
Regards,
Iftikar
0
0
I assume there is a table in the database called UserInfo and UserInfo.cs is the model of that table.
What is the role of UserTable.cs?
UserInforBusinessLayer.cs - hope this should be calling the functions in UserInfoDataAccess.cs?UserInfoDataAccess.cs should be using UserInfo.cs?
0
Hi,
You can have project as shown below
DataModel - Put all your model class in this project (only for the BusinessLayer)
DataAccess - Put all your data access layer classes over here. In this layer you will just get data from your DB thru either EF or ADO.NET or classing way and use only the data model which is just the replica of your DB table.
BusinessLayer - Here you can put all your business layer classes, in this you will call DataAccess classes and format your BusinessLayer by using Business Data Model
For Ex.
I want to reterive user information from DB
EmpDataModel
- UserInfo.cs
EmpDataAccess
- UserInfoDataAccess.cs
- UserTable.cs
EmpBusinessLayer
- UserInforBusinessLayer.cs (will be using UserInfo.cs)
MainWebProject
- Cotroller - will call EmpBusinessLayer
- Views
- And other folder like Images, Script etc. (but will not contain Model)
Regards,
Iftikar