Constraining string length in domain classes
I have a persistence ignorant domain model that uses abstract repositories to load domain objects. The concrete implementation of my repositories (the data access layer (DAL)) uses entity framework to fetch data from a sql server database. The database has length constraints on a lot of its varchar columns. Now imagine that I have the following domain class: public class Case { public Case(int id, string text) { this.Id = id; this.Text = text; } public int Id { get; private set; } public string Text { get; set; } } And an abstract repository defined as follows: public abstract class