title: Override or hide property in partial class
body: <p>I have read around quite a bit now and think that the following is not doable, but I would like to have confirmation from experts if possible and possibly advice on a "best" workaround.</p>
  
  <p>In all the auto-generated linq-to-sql classes I end up doubling up on all properties to carry out checks on the values as they are set, say, I have a Person class with a Name property on which I end up doing:</p>
  
  <pre><code>public partial class Person
  {
      public string Name
      {
          get { return this._Name; }
          set
          {
              if (!string.IsNullOrEmpty(value))
              {
                  value = value.trim();
                  this._Name = value.Substring(0, Math.Min(value.Length, 200));
              }
              else
                  throw new InvalidOperationException("Person name cannot be blank");
          }
      }
  }
  </code></pre>
  
  <p>Simple check to ensure that when I persist to the database the name won't exceed the maximum length.</p>
  
  <p>Which means I end up doubling up on nearly every single property from the auto-generated class and that makes a massive mess because they end up all being named something similar.</p>
  
  <p>I tried adding a layer on top of the partial classes by making my own representation of the objects, but ran into problems when instantiating classes which depended one on the other... Say a person has a company, you instantiate person and its company which instantiates persons for the company, which reinstantiates companies etc...</p>
  
  <p>Is there some "good" way to do what I am trying to do with the partial classes? If not, what are the alternatives that work best? 
  Maybe inheriting every single partial class and overriding the properties? Using the OnChange events to perform the checks?</p>