Reputation: 1
I had created one .dbml file. I want to do coding in 3 tier architecture. Now I have one table like UserMaster in dbml file. Can I use that UserMaster in my aspx.cs page? or I have to create properties and assign values in business logic?
Upvotes: 0
Views: 256
Reputation: 218722
The whole point of separating into differnt layer is to bring some loosly coupling and abstraction so that the UI layer wont know what database access technology you are using at the Data Access level. So i think you should not share the UserMaster table directly to the UI layer. You better read data from the data source and then fill your POCO classes and return that to your UI layer.
So i would create a method which return a List of User (object of your User Entity class) to do this. So if there is a change (you waant to map the DisplayName field from FirstName to some other field), You make change in one place (your data layer) and you will have this change in all the places where you call this method.
Upvotes: 3