I am busy reading and enjoying, Injecting dependencies in .Net by Mark Seman.
It's hard for me to explain the exact context, so please just ask this question if you are familiar with the book.
My question is related to the two Product classes in chapter 2 pg 49. There are one and one at the data access level in the domain layer. It is explained that the Product class at the data access level was created by the Linq to Entity wizard.
I work with Linq for SQL, and I could beautify my model class with Ling to SQL attributes, so I don't need to have a second class. For instance.
[Table(Name="Customers")] public class Customer { [Column(IsPrimaryKey=true)] public string CustomerID; [Column] public string City; }
However, I feel that this is confusing issues, and it will greatly affect my level of access to the Linq to SQL data access level. Do you agree with that?
Suppose I create two classes "Client" for the level of access to domains and data. Let them say that the City is a required field. When saving, this rule must be checked. Should this be done at the domain level or at the data access level, or both?
Thanks Darin
Daryn source share